Created
April 29, 2016 19:05
-
-
Save who/a336f9a30d55e0a1a6025b855d39c2dc to your computer and use it in GitHub Desktop.
This file contains 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" : "foo", | |
"version" : "v1", | |
"title" : "foo", | |
"contact" : { | |
"name" : "foo", | |
"url" : "http://www.example.com", | |
"email" : "example@example.com" | |
}, | |
"license" : { | |
"name" : "n/a", | |
"url" : "http://www.example.com" | |
} | |
}, | |
"basePath" : "/example", | |
"tags" : [ { | |
"name" : "Example" | |
} ], | |
"schemes" : [ "https", "http" ], | |
"paths" : { | |
"/animals" : { | |
"post" : { | |
"tags" : [ "Example" ], | |
"summary" : "hello", | |
"description" : "", | |
"operationId" : "createAnimal", | |
"consumes" : [ "application/json" ], | |
"produces" : [ "application/json" ], | |
"parameters" : [ { | |
"in" : "body", | |
"name" : "body", | |
"description" : "A payload", | |
"required" : true, | |
"schema" : { | |
"$ref" : "#/definitions/Animal" | |
} | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "Resource exists, valid data in response body", | |
"schema" : { | |
"type" : "object", | |
"additionalProperties" : { | |
"type" : "object" | |
} | |
} | |
}, | |
"400" : { | |
"description" : "Bad request. Input validation failure." | |
}, | |
"403" : { | |
"description" : "Authentication failure" | |
}, | |
"404" : { | |
"description" : "Resource not found" | |
}, | |
"500" : { | |
"description" : "Server side failure" | |
} | |
} | |
} | |
} | |
}, | |
"definitions" : { | |
"Animal" : { | |
"type" : "object", | |
"required" : [ "type" ], | |
"discriminator" : "type", | |
"properties" : { | |
"type" : { | |
"type" : "string", | |
"enum" : [ "DOG","CAT" ] | |
} | |
} | |
}, | |
"Dog" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/Animal" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"dogParam1" : { | |
"type" : "string" | |
}, | |
"dogParam2" : { | |
"type" : "string" | |
} | |
} | |
} ] | |
}, | |
"Cat" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/Animal" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"catParam1" : { | |
"type" : "string" | |
}, | |
"catParam2" : { | |
"type" : "string" | |
} | |
} | |
} ] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment