chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"openapi": "3.0.1",
|
||||
"info": {
|
||||
"title": "Pets API",
|
||||
"version": "1.0.0",
|
||||
"description": "API for managing pets."
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://api.yourdomain.com"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/pets": {
|
||||
"patch": {
|
||||
"summary": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "updatePet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{ "$ref": "#/components/schemas/Cat" },
|
||||
{ "$ref": "#/components/schemas/Dog" }
|
||||
],
|
||||
"discriminator": {
|
||||
"propertyName": "pet_type"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Updated"
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "createPet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{ "$ref": "#/components/schemas/Cat" },
|
||||
{ "$ref": "#/components/schemas/Dog" }
|
||||
],
|
||||
"discriminator": {
|
||||
"propertyName": "pet_type"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Pet": {
|
||||
"type": "object",
|
||||
"required": [ "pet_type" ],
|
||||
"properties": {
|
||||
"pet_type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"discriminator": {
|
||||
"propertyName": "pet_type"
|
||||
}
|
||||
},
|
||||
"Dog": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/components/schemas/Pet" },
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bark": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"breed": {
|
||||
"type": "string",
|
||||
"enum": [ "Dingo", "Husky", "Retriever", "Shepherd" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Cat": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/components/schemas/Pet" },
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hunts": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"age": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"openapi": "3.0.1",
|
||||
"info": {
|
||||
"title": "Pets API",
|
||||
"version": "1.0.0",
|
||||
"description": "API for managing pets."
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://api.yourdomain.com"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/pets": {
|
||||
"patch": {
|
||||
"summary": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "updatePet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/components/schemas/PetByAge" },
|
||||
{ "$ref": "#/components/schemas/PetByType" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Updated"
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"summary": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "createPet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/components/schemas/PetByAge" },
|
||||
{ "$ref": "#/components/schemas/PetByType" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Create"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"PetByAge": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"age": {
|
||||
"type": "integer"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [ "age" ]
|
||||
},
|
||||
"PetByType": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pet_type": {
|
||||
"type": "string",
|
||||
"enum": [ "Cat", "Dog" ]
|
||||
},
|
||||
"hunts": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [ "pet_type" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"openapi": "3.0.1",
|
||||
"info": {
|
||||
"title": "Pets API",
|
||||
"version": "1.0.0",
|
||||
"description": "API for managing pets."
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "https://api.yourdomain.com"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/pets": {
|
||||
"patch": {
|
||||
"summary": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Update a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "updatePet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{ "$ref": "#/components/schemas/Cat" },
|
||||
{ "$ref": "#/components/schemas/Dog" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Updated"
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"description": "Create a pet. Call this with either details for a dog or a cat but not both.",
|
||||
"operationId": "createPet",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"oneOf": [
|
||||
{ "$ref": "#/components/schemas/Cat" },
|
||||
{ "$ref": "#/components/schemas/Dog" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Dog": {
|
||||
"type": "object",
|
||||
"description": "A representation of a dog. Do not use for a cat.",
|
||||
"properties": {
|
||||
"bark": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"breed": {
|
||||
"type": "string",
|
||||
"enum": [ "Dingo", "Husky", "Retriever", "Shepherd" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Cat": {
|
||||
"type": "object",
|
||||
"description": "A representation of a cat. Do not use for a dog.",
|
||||
"properties": {
|
||||
"hunts": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"age": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user