{
"openapi": "3.0.3",
"info": {
"title": "Todo",
"version": "0.1.0"
},
"paths": {
"/todos": {
"post": {
"operationId": "todos_Create",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/CreateInput" }
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Todo" }
}
}
}
}
},
"get": {
"operationId": "todos_List",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ListOutput" }
}
}
}
}
}
},
"/todos/{id}": {
"get": {
"operationId": "todos_Get",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Todo" }
}
}
}
}
}
}
},
"components": {
"schemas": {
"CreateInput": {
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": "string" }
},
"required": ["title", "description"]
},
"Todo": {
"type": "object",
"properties": {
"id": { "type": "string" },
"title": { "type": "string" },
"description": { "type": "string" },
"completed": { "type": "boolean" },
"createdAt": { "type": "string", "format": "date-time" }
},
"required": ["id", "title", "description", "completed", "createdAt"]
},
"ListOutput": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": { "$ref": "#/components/schemas/Todo" }
},
"total": { "type": "integer", "format": "int32" }
},
"required": ["items", "total"]
}
}
}
}