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

A way to import schemas? - import schemas from a path to module instead of the full path #989

Closed
juhaku opened this issue Aug 11, 2024 Discussed in #788 · 1 comment
Closed

Comments

@juhaku
Copy link
Owner

juhaku commented Aug 11, 2024

Discussed in #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>
@juhaku
Copy link
Owner Author

juhaku commented Sep 11, 2024

Closing this for now, this is going to be handled differently.

@juhaku juhaku closed this as completed Sep 11, 2024
@juhaku juhaku moved this from Done to Released in utoipa kanban Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

No branches or pull requests

1 participant