| 1 |
{ |
| 2 |
"swagger": "2.0", |
| 3 |
"info": { |
| 4 |
"version": "1.0", |
| 5 |
"title": "To-do Demo", |
| 6 |
"description": |
| 7 |
"### Notes:\n\nThis OAS2 (Swagger 2) specification defines common models and responses, that other specifications may reference.\n\nFor example, check out the user poperty in the main.oas2 todo-partial model - it references the user model in this specification!\n\nLikewise, the main.oas2 operations reference the shared error responses in this common specification.", |
| 8 |
"contact": { |
| 9 |
"name": "Stoplight", |
| 10 |
"url": "https://stoplight.io" |
| 11 |
}, |
| 12 |
"license": { |
| 13 |
"name": "MIT" |
| 14 |
} |
| 15 |
}, |
| 16 |
"host": "example.com", |
| 17 |
"securityDefinitions": {}, |
| 18 |
"paths": {}, |
| 19 |
"responses": { |
| 20 |
"401": { |
| 21 |
"description": "", |
| 22 |
"schema": { |
| 23 |
"$ref": "#/definitions/error-response" |
| 24 |
}, |
| 25 |
"examples": { |
| 26 |
"application/json": { |
| 27 |
"status": "401", |
| 28 |
"error": "Not Authorized" |
| 29 |
} |
| 30 |
} |
| 31 |
}, |
| 32 |
"403": { |
| 33 |
"description": "", |
| 34 |
"schema": { |
| 35 |
"$ref": "#/definitions/error-response" |
| 36 |
}, |
| 37 |
"examples": { |
| 38 |
"application/json": { |
| 39 |
"status": "403", |
| 40 |
"error": "Forbbiden" |
| 41 |
} |
| 42 |
} |
| 43 |
}, |
| 44 |
"404": { |
| 45 |
"description": "", |
| 46 |
"schema": { |
| 47 |
"$ref": "#/definitions/error-response" |
| 48 |
}, |
| 49 |
"examples": { |
| 50 |
"application/json": { |
| 51 |
"status": "404", |
| 52 |
"error": "Not Found" |
| 53 |
} |
| 54 |
} |
| 55 |
}, |
| 56 |
"500": { |
| 57 |
"description": "", |
| 58 |
"schema": { |
| 59 |
"$ref": "#/definitions/error-response" |
| 60 |
}, |
| 61 |
"examples": { |
| 62 |
"application/json": { |
| 63 |
"status": "500", |
| 64 |
"error": "Server Error" |
| 65 |
} |
| 66 |
} |
| 67 |
} |
| 68 |
}, |
| 69 |
"definitions": { |
| 70 |
"user": { |
| 71 |
"title": "User", |
| 72 |
"type": "object", |
| 73 |
"properties": { |
| 74 |
"name": { |
| 75 |
"type": "string", |
| 76 |
"description": "The user's full name." |
| 77 |
}, |
| 78 |
"age": { |
| 79 |
"type": "number", |
| 80 |
"minimum": 0, |
| 81 |
"maximum": 150 |
| 82 |
}, |
| 83 |
"error": { |
| 84 |
"$ref": "#/definitions/error-response" |
| 85 |
} |
| 86 |
}, |
| 87 |
"required": ["name", "age"] |
| 88 |
}, |
| 89 |
"error-response": { |
| 90 |
"type": "object", |
| 91 |
"title": "Error Response", |
| 92 |
"properties": { |
| 93 |
"status": { |
| 94 |
"type": "string" |
| 95 |
}, |
| 96 |
"error": { |
| 97 |
"type": "string" |
| 98 |
} |
| 99 |
}, |
| 100 |
"required": ["status", "error"] |
| 101 |
} |
| 102 |
} |
| 103 |
} |