Add OpenAPI specification and generation command
This commit is contained in:
82
apps/api/swagger.json
Normal file
82
apps/api/swagger.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
justfile
5
justfile
@@ -41,6 +41,11 @@ generate-entity:
|
|||||||
# delegate to cli
|
# delegate to cli
|
||||||
just cli db:migrate_and_generate --output-path ../../public/database/src/generated/entities
|
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:
|
||||||
# build frontend assets
|
# build frontend assets
|
||||||
cd apps/frontend && \
|
cd apps/frontend && \
|
||||||
|
|||||||
Reference in New Issue
Block a user