Files
2026-10-15 17:33:06 +03:00

185 lines
3.5 KiB
JSON

{
"openapi": "3.1.1",
"info": {
"title": "PokedexApi | v1",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:5211/"
}
],
"paths": {
"/hello": {
"get": {
"tags": [
"PokedexApi"
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/pokemons": {
"get": {
"tags": [
"PokedexApi"
],
"responses": {
"200": {
"description": "OK"
}
}
},
"post": {
"tags": [
"PokedexApi"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PokemonInput"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/pokemons/{id}": {
"get": {
"tags": [
"PokedexApi"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
],
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
},
"put": {
"tags": [
"PokedexApi"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
],
"format": "int32"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PokemonInput"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK"
}
}
},
"delete": {
"tags": [
"PokedexApi"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
],
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
},
"components": {
"schemas": {
"PokemonInput": {
"required": [
"name",
"type",
"level"
],
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"level": {
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
],
"format": "int32"
}
}
}
}
},
"tags": [
{
"name": "PokedexApi"
}
]
}