utoipa
utoipa copied to clipboard
A way to import schemas? - import schemas from a path to module instead of the full path
Discussed in https://github.com/juhaku/utoipa/discussions/788
Originally posted by ctron October 31, 2023 The documented approach I see is:
#[derive(OpenApi)]
#[openapi(
paths(),
components(
schemas(
foo::Bar,
foo::Baz,
)
),
)]
pub struct ApiDoc;
Now, if I don't want to repeat myself, listing every type of the schema again, is there a way to import a full module? Like:
#[openapi(
paths(),
components(
schemas(
foo
)
),
)]
```</div>