Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"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