Add OpenAPI generator

This commit is contained in:
gabdevele
2026-06-02 20:40:45 +02:00 Unverified
parent 1ef41bb2a3
commit 3f0a5ecf9b
9 changed files with 278 additions and 1 deletions
+17
View File
@@ -31,6 +31,8 @@ MailHog listens on `http://localhost:8025`.
Local CORS allows `http://localhost:5173` by default for the future Vue frontend.
Multipart uploads currently accept report images and videos up to the app body
limit configured in `config.json`.
Swagger UI is available at `http://localhost:5555/api/v1/docs` after the app
has been built.
Local seeded admin:
@@ -71,6 +73,19 @@ discoverable by CMake. The default build uses CPM.cmake and downloads Drogon
- `docs/DATABASE_SCHEMA.md`: schema overview.
- `docs/ARCHITECTURE.md`: backend structure.
## OpenAPI
The OpenAPI spec is generated from Drogon controller route macros, not written
as a static Swagger file.
```bash
cmake --build build --target openapi
python3 -m json.tool build/openapi/visione.openapi.json >/dev/null
```
The app serves the generated JSON at `/api/v1/openapi.json` and Swagger UI at
`/api/v1/docs`.
## Development Workflow
1. Keep MySQL running with `docker compose up -d`.
@@ -89,6 +104,8 @@ cmake --build build
ctest --test-dir build --output-on-failure
```
8. After each completed and verified feature, create a short commit.
The `RequestLogger` plugin logs every response as method, path, status and
client address.