The Cat API
お試しにちょうどいいのでたまに使う。
Swagger.json
その Swagger.json を作りたかったので作ったもの。
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "The Cat API",
"description": "An API for accessing cat images and data"
},
"host": "api.thecatapi.com",
"basePath": "/v1",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/images/search": {
"get": {
"summary": "Search cat images",
"description": "Returns a list of cat images based on search criteria",
"parameters": [
{
"name": "limit",
"in": "query",
"description": "The maximum number of results to return",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "page",
"in": "query",
"description": "The page number of results to return",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "breed_id",
"in": "query",
"description": "The ID of the breed to search for",
"required": false,
"type": "string"
},
{
"name": "size",
"in": "query",
"description": "The size of the image to return (full or medium)",
"required": false,
"type": "string",
"enum": [
"full",
"medium"
]
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Image"
}
}
}
}
}
}
},
"definitions": {
"Image": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the image"
},
"url": {
"type": "string",
"description": "The URL of the image"
},
"breeds": {
"type": "array",
"items": {
"$ref": "#/definitions/Breed"
},
"description": "The list of breeds associated with the image"
}
}
},
"Breed": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The ID of the breed"
},
"name": {
"type": "string",
"description": "The name of the breed"
},
"description": {
"type": "string",
"description": "The description of the breed"
}
}
}
}
}
Swagger のためのツール
あと Chat GPT。
カスタム コネクタ
完成
以上