utoipauto
utoipauto copied to clipboard
Customize reported path
Hey, awesome library! In #2, a user asked to have full paths reported; but I want the opposite: I want to be able to customize the path so that the full thing isn't reported.
For example, if I add paths manually, this works- but I don't see a way to both auto-discover and not have the full path displayed.
In the below example (using Scalar
to render the docs), the main ApiDoc
is configured like so:
// Note: the below code snippet is inside `crate::api`.
#[utoipauto] // <-- This autodiscovers `crate::api::v1::ping`
#[derive(OpenApi)]
#[openapi(info(description = include_str!("../README.md")), paths(
v0::health::handle, // <-- This is also autodiscovered, but overridden
))]
struct ApiDoc;
The manually added route correctly (for my preferences anyway) appears relative, but the autodiscovered one has the full path; I'm wondering if there's a way to override this behavior to make the path relative.
Thanks for your time!