Created
February 1, 2018 08:08
-
-
Save ymilin/74a804dc5130dfda2c2c6ed349f22865 to your computer and use it in GitHub Desktop.
swagger with default error Model
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": { | |
| "description": "", | |
| "version": "1.0.0", | |
| "title": "Swagger Petstore" | |
| }, | |
| "host": "petstore.swagger.io", | |
| "tags": [ | |
| { | |
| "name": "pet", | |
| "description": "Everything about your Pets" | |
| } | |
| ], | |
| "schemes": [ | |
| "http" | |
| ], | |
| "paths": { | |
| "/pet/{petId}": { | |
| "get": { | |
| "tags": [ | |
| "pet" | |
| ], | |
| "summary": "Find pet by ID", | |
| "description": "Returns a single pet", | |
| "operationId": "getPetById", | |
| "produces": [ | |
| "application/json" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "petId", | |
| "in": "path", | |
| "description": "ID of pet to return", | |
| "required": true, | |
| "type": "integer", | |
| "format": "int64" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "successful operation", | |
| "schema": { | |
| "$ref": "#/definitions/Pet" | |
| } | |
| }, | |
| "default": { | |
| "description": "Unexpected error", | |
| "schema": { | |
| "$ref": "#/definitions/ErrorModel" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "definitions": { | |
| "Pet": { | |
| "type": "object", | |
| "required": [ | |
| "name" | |
| ], | |
| "properties": { | |
| "id": { | |
| "type": "integer", | |
| "format": "int64" | |
| }, | |
| "name": { | |
| "type": "string" | |
| } | |
| }, | |
| "xml": { | |
| "name": "Pet" | |
| } | |
| }, | |
| "ErrorModel": { | |
| "type": "object", | |
| "properties": { | |
| "code": { | |
| "type": "integer", | |
| "format": "int32" | |
| }, | |
| "message": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment