diff --git a/apps/api/swagger.json b/apps/api/swagger.json new file mode 100644 index 0000000..7e8f40a --- /dev/null +++ b/apps/api/swagger.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "yet-another-nginx-proxy-manager", + "description": "", + "license": { + "name": "" + }, + "version": "0.1.0" + }, + "paths": { + "/api/health/info": { + "get": { + "tags": [ + "crate::routes::api::health::info" + ], + "operationId": "get_health_info", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Pet database id to get Pet for", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + ], + "responses": { + "200": { + "description": "Health information retrieved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HealthInfo" + } + } + } + }, + "404": { + "description": "Health information not found" + } + } + } + } + }, + "components": { + "schemas": { + "HealthInfo": { + "type": "object", + "required": [ + "status", + "version", + "up_since" + ], + "properties": { + "errors": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "status": { + "type": "string" + }, + "up_since": { + "type": "string", + "format": "date-time" + }, + "version": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/justfile b/justfile index a048e1d..14a1462 100644 --- a/justfile +++ b/justfile @@ -41,6 +41,11 @@ generate-entity: # delegate to cli just cli db:migrate_and_generate --output-path ../../public/database/src/generated/entities +generate-openapi: + # delegate to cli + cd apps/api && \ + cargo run -- generate:openapi --output-path ./swagger.json + build-frontend: # build frontend assets cd apps/frontend && \