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

Disable Module Tagging? #1240

Open
wyatt-herkamp opened this issue Dec 16, 2024 · 1 comment
Open

Disable Module Tagging? #1240

wyatt-herkamp opened this issue Dec 16, 2024 · 1 comment

Comments

@wyatt-herkamp
Copy link
Contributor

If I have the following openapi declaration it will tag lookup with base. I don't always want this. How can I force it to not tag lookup in base?

#[derive(OpenApi)]
#[openapi(
    paths(
        list,
        base::lookup,
    ),
    components(schemas(
        SomeSchema
    ))
)]
pub struct MyAPI;
@juhaku
Copy link
Owner

juhaku commented Dec 16, 2024

Only way to make it not to "auto tag" it, is to import the handler to the module and use the fully qualified function name same as the list is done.

Another way around this is to use nesting. This can be done with nest attribute on #[openapi(...)] macro or via nesting or merging via methods on OpenApi instance. But as with the paths(...) the nestable module needs to be fully imported otherwise #[openapi(...nest(...), )] will automatically tag the endpoints with the path to the module.

Probably this auto tagging behavior could be controlled via utoipa-config eventually, but no such work has been done.

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