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

Two response types for the same http code. #1418

Open
rdossantoslgc opened this issue Aug 16, 2021 · 0 comments
Open

Two response types for the same http code. #1418

rdossantoslgc opened this issue Aug 16, 2021 · 0 comments

Comments

@rdossantoslgc
Copy link

Is it possible to specify two possible types on the Response?

Here is what I need:

[SwaggerResponse((int)HttpStatusCode.BadRequest, type: typeof(ValidationProblemDetails))]
[SwaggerResponse((int)HttpStatusCode.BadRequest, type: typeof(ProblemDetails))]

I know you can achieve that in OpenAPI pattern with oneOf

But the last one always overrides the previous, I wanted to let the consumer know that if he/she gets a 400 it could be a validation error or something else.

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

1 participant