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

Specific error handling #79

Closed
Joseda8 opened this issue Mar 11, 2022 · 1 comment
Closed

Specific error handling #79

Joseda8 opened this issue Mar 11, 2022 · 1 comment

Comments

@Joseda8
Copy link

Joseda8 commented Mar 11, 2022

Following the Custom Schema example I saw the errors are defined by doing in the error.rs file:

        responses.insert(
            "400".to_string(),
            RefOr::Object(OpenApiReponse {
                description: "Description".to_string(),
                ..Default::default()
            }),
        );

I would like to know. Is it possible to show this error in some few endpoints only? Currently this code is adding this error to all endpoints in Swagger.

@ralpha
Copy link
Collaborator

ralpha commented Mar 11, 2022

Yes, see my reply here: #77 (comment)

Short is: create multiple error structs or use one of the methods described here: #34 (comment)

I'll close this issue because of duplicates to #34 and #77.
If you have more questions, just ask.

@ralpha ralpha closed this as completed Mar 11, 2022
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