feature/openapi #7

Merged
GW_MC merged 10 commits from feature/openapi into master 2025-12-05 20:50:37 +08:00
2 changed files with 87 additions and 0 deletions
Showing only changes of commit 8875122e1b - Show all commits

82
apps/api/swagger.json Normal file
View File

@@ -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"
}
}
}
}
}
}

View File

@@ -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 && \