Skip to content

Instantly share code, notes, and snippets.

@matt212
Created January 31, 2019 21:02
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 matt212/7dd0906bb6a3734a9e3bcc6342b22f49 to your computer and use it in GitHub Desktop.
Save matt212/7dd0906bb6a3734a9e3bcc6342b22f49 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"description": "This is a sample server Petstore server.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"paths": {
"/pets": {
"patch": {
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/Cat"
},
{
"$ref": "#/components/schemas/Dog"
}
]
}
}
}
},
"responses": {
"200": {
"description": "Updated"
}
}
}
}
},
"components": {
"schemas": {
"Dog": {
"type": "object",
"properties": {
"bark": {
"type": "boolean"
},
"breed": {
"type": "string",
"enum": [
"Dingo",
"Husky",
"Retriever",
"Shepherd"
]
}
}
},
"Cat": {
"type": "object",
"properties": {
"hunts": {
"type": "boolean"
},
"age": {
"type": "integer"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment