Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize reported path #26

Open
jssblck opened this issue May 16, 2024 · 1 comment
Open

Customize reported path #26

jssblck opened this issue May 16, 2024 · 1 comment

Comments

@jssblck
Copy link

jssblck commented May 16, 2024

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.

Screenshot 2024-05-16 at 4 41 58 PM

Thanks for your time!

@DenuxPlays
Copy link
Collaborator

Maybe not your solution but I ordered my routes into tags.
This also allows you to add a basic description.

Works for me but maybe not for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants