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

Swagger does not respond with bad request and instead responds with 406 #2125

Open
VictorioBerra opened this issue Jul 26, 2023 · 0 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@VictorioBerra
Copy link
Collaborator

Describe the bug

Generate a new template but set -xf to None (no XML formatters).

Launch Swagger, make a POST request to cars.

Change the JSON Model property to null.

Notice you get a 406, not a 400.

Steps to reproduce

Generate a new template but set -xf to None (no XML formatters).
Launch Swagger, make a POST request to cars.
Change the JSON Model property to null.
Notice you get a 406, not a 400.

Expected behaviour

You should get a 400 with helpful model state errors.

Template

API

.NET Boxed Version

Latest

Visual Studio Version

VS22

.NET Version

.NET 7

@VictorioBerra VictorioBerra added the bug Issues describing a bug or pull requests fixing a bug. label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

1 participant