Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save who/a336f9a30d55e0a1a6025b855d39c2dc to your computer and use it in GitHub Desktop.
Save who/a336f9a30d55e0a1a6025b855d39c2dc to your computer and use it in GitHub Desktop.
{
"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