docs: Create JsonSuccess and JsonError definitions.

This commit is contained in:
Yago González 2017-05-23 15:50:26 -07:00 committed by Tim Abbott
parent e5d4e0f0eb
commit d56ec79dd9
1 changed files with 25 additions and 13 deletions

View File

@ -412,22 +412,11 @@ paths:
'200':
description: Success
schema:
type: object
required:
- msg
- result
properties:
msg:
type: string
result:
type: string
$ref: '#/definitions/JsonSuccess'
'400':
description: Bad request.
schema:
type: object
required:
- msg
- result
$ref: '#/definitions/JsonError'
properties:
msg:
type: string
@ -459,6 +448,29 @@ securityDefinitions:
####################
# Shared definitions
definitions:
JsonResponse:
type: object
properties:
msg:
type: string
required: true
result:
type: string
required: true
JsonSuccess:
allOf:
- $ref: '#/definitions/JsonResponse'
properties:
msg:
default: success
JsonError:
allOf:
- $ref: '#/definitions/JsonResponse'
properties:
msg:
default: error
# /messages
MessageResponse: