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

Use JSON Property Name attributes when creating ModelState Validation errors #39008

Merged

Conversation

brunolins16
Copy link
Member

@brunolins16 brunolins16 commented Dec 13, 2021

Fixes #39010

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Dec 13, 2021
@brunolins16 brunolins16 changed the title Core functionality Use JSON Property Name attributes when creating ModelState Validation errors Dec 13, 2021
…ationMetadataProvider.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>
Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get a few tests with these providers?

@brunolins16
Copy link
Member Author

Could we get a few tests with these providers?

I am working on it, just pushed the unit tests for STJProvider.

@brunolins16 brunolins16 marked this pull request as ready for review January 3, 2022 23:37
Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Do you mind filing a doc issue so we can tell users how to use / configure these? Thanks!

Comment on lines +73 to +76
{
new UpperCaseJsonNamingPolicy(),
new CamelCaseNamingStrategy()
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
new UpperCaseJsonNamingPolicy(),
new CamelCaseNamingStrategy()
};
{
new UpperCaseJsonNamingPolicy(),
new CamelCaseNamingStrategy()
};

Nit, feel free to ignore it / do it in a separate PR

@brunolins16 brunolins16 merged commit c68d3b7 into dotnet:main Jan 7, 2022
@ghost ghost added this to the 7.0-preview1 milestone Jan 7, 2022
@brunolins16 brunolins16 deleted the brunolins16/issues/17999-api-suggestions branch January 7, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use JSON Property Name attributes when creating ModelState Validation errors
3 participants