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

Hide operation parameters from OpenAPI schema #919

Open
Shadow53 opened this issue Nov 27, 2024 · 0 comments
Open

Hide operation parameters from OpenAPI schema #919

Shadow53 opened this issue Nov 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Shadow53
Copy link

Description of the feature

I'm using the RequestId middleware with poem_openapi. Every operation takes a custom RequestId type as an argument (which extracts the header added by the middleware) for use in the operation itself. Since the header is added by middleware, I don't want it to appear in the generate OpenAPI spec. A #[oai(hidden)] attribute would be a nice parallel with the same attribute on the operation.

Code example (if possible)

#[OpenAPI]
impl Api {
    #[oai(...)]
    async fn operation(
        &self,
        #[oai(hidden)] request_id: RequestId,  // This
        ...,
    ) -> Result<()> {
        todo!()
    }
}
@Shadow53 Shadow53 added the enhancement New feature or request label Nov 27, 2024
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

1 participant