oxidite-openapi
OpenAPI 3.0 document structures and helpers for Oxidite.
Installation
[]
= "2.3.3"
What This Crate Provides
- OpenAPI spec data structures (
OpenApiSpec,PathItem,Operation, etc.) OpenApiBuilderfor assembling a spec- Helper constructors for common operations and schemas
- Swagger UI HTML generation via
generate_docs_html
Quick Example
use ;
let list_users = get_operation
.with_description
.add_parameter
.add_response;
let spec = new
.description
.path
.build;
let html = generate_docs_html;
assert!;
Router Integration
If you use oxidite_core::Router, you can register docs endpoints in one call:
# use Router;
# use ;
let router = new;
let spec = new.build;
let _router = router.with_auto_docs; // mounts /openapi.json and /api/docs
Notes
- This crate does not currently include proc-macro annotations or automatic route introspection.
- Integrate by exposing the generated spec at an endpoint (for example
/openapi.json) and servinggenerate_docs_htmloutput.