Skip to content

Instantly share code, notes, and snippets.

@shreks7
Last active December 28, 2025 16:42
Show Gist options
  • Select an option

  • Save shreks7/1d54f07f0654b321fde9263a6447dca7 to your computer and use it in GitHub Desktop.

Select an option

Save shreks7/1d54f07f0654b321fde9263a6447dca7 to your computer and use it in GitHub Desktop.
Cats openapi 3.0.0
{
"openapi": "3.0.0",
"info": {
"title": "Cat Fact API",
"description": "An API for facts about cats",
"contact": {
"email": "contact@catfact.ninja"
},
"version": "1.0.0"
},
"servers": [
{
"url": "https://catfact.ninja/"
}
],
"paths": {
"/breeds": {
"get": {
"tags": [
"Breeds"
],
"summary": "Get a list of breeds",
"description": "Returns a a list of breeds",
"operationId": "getBreeds",
"parameters": [
{
"name": "limit",
"in": "query",
"description": "limit the amount of results returned",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Breed"
}
}
}
}
}
}
}
},
"/fact": {
"get": {
"tags": [
"Facts"
],
"summary": "Get Random Fact",
"description": "Returns a random fact",
"operationId": "getRandomFact",
"parameters": [
{
"name": "max_length",
"in": "query",
"description": "maximum length of returned fact",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CatFact"
}
}
}
},
"404": {
"description": "Fact not found"
}
}
}
},
"/facts": {
"get": {
"tags": [
"Facts"
],
"summary": "Get a list of facts",
"description": "Returns a a list of facts",
"operationId": "getFacts",
"parameters": [
{
"name": "max_length",
"in": "query",
"description": "maximum length of returned fact",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "limit",
"in": "query",
"description": "limit the amount of results returned",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CatFact"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Breed": {
"title": "Breed model",
"description": "Breed",
"properties": {
"breed": {
"title": "Breed",
"description": "Breed",
"type": "string",
"format": "string"
},
"country": {
"title": "Country",
"description": "Country",
"type": "string",
"format": "string"
},
"origin": {
"title": "Origin",
"description": "Origin",
"type": "string",
"format": "string"
},
"coat": {
"title": "Coat",
"description": "Coat",
"type": "string",
"format": "string"
},
"pattern": {
"title": "Pattern",
"description": "Pattern",
"type": "string",
"format": "string"
}
},
"type": "object"
},
"CatFact": {
"title": "CatFact model",
"description": "CatFact",
"properties": {
"fact": {
"title": "Fact",
"description": "Fact",
"type": "string",
"format": "string"
},
"length": {
"title": "Length",
"description": "Length",
"type": "integer",
"format": "int32"
}
},
"type": "object"
}
}
},
"tags": [
{
"name": "Facts",
"description": "Cat Facts"
},
{
"name": "Breeds",
"description": "Breeds"
}
],
"security": [
[]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment