Expand description
umbral-openapi — auto-generated OpenAPI 3.0 schema + Swagger UI.
Register OpenApiPlugin on App::builder() alongside
RestPlugin. The plugin walks the migration registry, drops the
tables umbral-rest hides by default, and emits an OpenAPI 3.0
document describing every remaining model’s REST surface.
Default mount point is /openapi/:
GET /openapi/openapi.json— the JSON specGET /openapi/— Swagger UI loaded from unpkg
Override via OpenApiPlugin::new().at("/api/docs") to put the UI
under /api/docs/ and the JSON under /api/docs/openapi.json.
§Scope
v1 only describes umbral-rest’s auto-generated endpoints. Hand-
written routes the user added on the builder are not in scope.
The spec emits a components.securitySchemes block populated from
the REST layer’s registered auth schemes (via
umbral_rest::registered_security_schemes()). List endpoints
include the pagination query parameters that match the configured
backend — page/page_size for umbral_rest::PageNumberPagination,
limit/offset for umbral_rest::LimitOffsetPagination, none for
umbral_rest::NoPagination (the default).
Structs§
- Open
ApiPlugin - The OpenAPI plugin.
Functions§
- spec_
url - Public read of the configured spec URL — the path the JSON
document is served at after
App::build()runs. ReturnsNonewhen OpenApiPlugin isn’t installed (the OnceLock hasn’t been populated byPlugin::routes()yet); returnsSome("/openapi/openapi.json")for the default mount andSome("/api/docs/openapi.json")when the user callsOpenApiPlugin::default().at("/api/docs").