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

[poem-openapi] How about put some common attributes on the impl scope? #54

Closed
umaYnit opened this issue Oct 11, 2021 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@umaYnit
Copy link
Contributor

umaYnit commented Oct 11, 2021

Description of the feature

How about put some common attributes on the impl scope?
such as prefix_path and openapi tag.

Code example (if possible)

#[OpenApi]
#[oai(prefix_path = "/pet", tag = ApiTags::Pet)]
impl Api {
    #[oai(path = "/", method = "post")]
    async fn add_pet(&self, pet: Json<Pet>) -> Result<()> {
        todo!()
    }
// ...
}
@umaYnit umaYnit added the enhancement New feature or request label Oct 11, 2021
sunli829 added a commit that referenced this issue Oct 12, 2021
 Add common attributes for OpenApi. #54
@umaYnit umaYnit closed this as completed Oct 12, 2021
@ollyde
Copy link

ollyde commented Mar 15, 2023

For anyone else who reads this and can't find docs.

#[OpenApi(prefix_path = "/api", tag = "ApiTags::Test")]
impl TestRoutesApi {}

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

No branches or pull requests

2 participants