Skip to content

Instantly share code, notes, and snippets.

@ymilin
Created February 1, 2018 08:08
Show Gist options
  • Select an option

  • Save ymilin/74a804dc5130dfda2c2c6ed349f22865 to your computer and use it in GitHub Desktop.

Select an option

Save ymilin/74a804dc5130dfda2c2c6ed349f22865 to your computer and use it in GitHub Desktop.
swagger with default error Model
{
"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