{
"openapi": "3.0.1",
"info": {
"title": "Demo Server API",
"version": "1.0.0",
"description": "OpenAPI specification generated from the FastAPI routes in `hello.py`.\n\nRoutes:\n- GET / -> returns a simple Hello World JSON.\n- GET /items/{item_id} -> returns the item id and optional query parameter `q`."
},
"servers": [
{
"description": "Local development server"
}
],
"paths": {
"/": {
"get": {
"summary": "Root endpoint 1",
"operationId": "read_root",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Hello": {
"type": "string",
"example": "World"
}
},
"required": ["Hello"]
}
}
}
}
}
}
},
"/{subpath}": {
"get": {
"summary": "Root endpoint 1",
"operationId": "read_root_subpath",
"parameters": [
{
"name": "subpath",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "Subpath to health check"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Hello": {
"type": "string",
"example": "World"
}
},
"required": ["Hello"]
}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Root endpoint 2",
"operationId": "read_root_health",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Hello": {
"type": "string",
"example": "World"
}
},
"required": ["Hello"]
}
}
}
}
}
}
},
"/items/{item_id}": {
"get": {
"summary": "Get an item by id",
"operationId": "read_item",
"parameters": [
{
"name": "item_id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
},
"description": "Numeric ID of the item to get"
},
{
"name": "q",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Optional query string"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"item_id": {
"type": "integer",
"format": "int32",
"example": 42
},
"q": {
"type": "string",
"nullable": true,
"example": "search"
}
},
"required": ["item_id"]
}
}
}
},
"404": {
"description": "Item not found"
}
}
}
}
},
"components": {}
}