-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Use JSON Property Name attributes when creating ModelState Validation errors #39008
Conversation
src/Mvc/Mvc.Core/src/ModelBinding/Validation/DefaultComplexObjectValidationStrategy.cs
Show resolved
Hide resolved
src/Mvc/Mvc.Core/src/ModelBinding/Metadata/JsonMetadataProvider.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcOptionsSetup.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonMetadataProvider.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonMetadataProvider.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.Core/src/ModelBinding/Metadata/SystemTextJsonValidationMetadataProvider.cs
Outdated
Show resolved
Hide resolved
…ationMetadataProvider.cs Co-authored-by: Pranav K <prkrishn@hotmail.com>
There was a problem hiding this 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?
src/Mvc/Mvc.NewtonsoftJson/src/DependencyInjection/NewtonsoftJsonMvcOptionsSetup.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonValidationMetadataProvider.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonValidationMetadataProvider.cs
Outdated
Show resolved
Hide resolved
I am working on it, just pushed the unit tests for STJProvider. |
There was a problem hiding this 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!
{ | ||
new UpperCaseJsonNamingPolicy(), | ||
new CamelCaseNamingStrategy() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | |
new UpperCaseJsonNamingPolicy(), | |
new CamelCaseNamingStrategy() | |
}; | |
{ | |
new UpperCaseJsonNamingPolicy(), | |
new CamelCaseNamingStrategy() | |
}; |
Nit, feel free to ignore it / do it in a separate PR
Fixes #39010