OpenAPI and Swagger UI
Generate an OpenAPI 3.0 document and interactive Swagger UI from Vectrune REST route and schema declarations.
Enable generated documentation
Set swagger = true under @App in a REST application. The server exposes /openapi.json and /swagger-ui.
curl http://127.0.0.1:3000/openapi.jsonWhat is generated
- An OpenAPI 3.0.0 document with title Vectrune API and version 1.0.0. These values are currently fixed by the generator.
- Route methods and URL paths, plus the route description when supplied.
- Required string path parameters extracted from placeholders such as {name}.
- Object schemas from @Schema sections. Declared fields are marked required.
- application/json request-body schemas for POST and PUT routes with a known expect schema.
Contract limits
The generator includes statically visible respond statuses, HTTP 400 for validate, HTTP 500 for runtime errors, and HTTP 200 when execution can fall through. It does not infer response body shapes from Rune values, so response schemas are strings matching the native REST handler's text/plain wire format.
Generated CRUD routes document their implemented success statuses, validation/not-found statuses where applicable, and runtime errors. Authentication middleware responses are not yet added to the generated contract.
The bundled Swagger UI page loads its JavaScript and stylesheet from unpkg.com. A browser needs access to that CDN to display the UI. The /openapi.json document itself is served locally.