Created
July 25, 2015 11:04
-
-
Save mxl/df3ad1b1a1b57502ec61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "API", | |
"description": "API" | |
}, | |
"schemes": [ | |
"http" | |
], | |
"paths": { | |
"/test1": { | |
"get": { | |
"description": "Test1", | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"$ref": "#/responses/default" | |
} | |
} | |
} | |
}, | |
"/test2": { | |
"get": { | |
"description": "Test2", | |
"produces": [ | |
"application/json" | |
], | |
"responses": { | |
"200": { | |
"description": "response", | |
"schema": { | |
"allOf": [ | |
{ | |
"$ref": "#/definitions/response" | |
}, | |
{ | |
"type": "object", | |
"properties": { | |
"token": { | |
"type": "string" | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
"definitions": { | |
"response": { | |
"properties": { | |
"errorCode": { | |
"default": 0, | |
"type": "integer", | |
"enum": [ | |
0, | |
1, | |
2, | |
3, | |
4, | |
5, | |
6, | |
7, | |
8, | |
9, | |
10, | |
11, | |
12 | |
], | |
"description": "Status code" | |
}, | |
"success": { | |
"default": true, | |
"type": "boolean", | |
"description": "Success flag" | |
} | |
} | |
} | |
}, | |
"responses": { | |
"default": { | |
"description": "response", | |
"schema": { | |
"$ref": "#/definitions/response" | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: '2.0' | |
info: | |
version: "1.0.0" | |
title: API | |
description: API | |
schemes: | |
- http | |
paths: | |
/test1: | |
get: | |
description: Test1 | |
produces: | |
- application/json | |
responses: | |
'200': | |
$ref: '#/responses/default' | |
/test2: | |
get: | |
description: Test2 | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: response | |
schema: | |
allOf: | |
- $ref: '#/definitions/response' | |
- type: object | |
properties: | |
token: | |
type: string | |
definitions: | |
response: | |
properties: | |
errorCode: | |
default: 0 | |
type: integer | |
enum: [0,1,2,3,4,5,6,7,8,9,10,11,12] | |
description: Status code | |
success: | |
default: true | |
type: boolean | |
description: Success flag | |
responses: | |
default: | |
description: response | |
schema: | |
$ref: '#/definitions/response' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment