-
Notifications
You must be signed in to change notification settings - Fork 117
[feature/10.0] Use validation source generator #8165
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
base: feature/10.0
Are you sure you want to change the base?
Conversation
This uses the new model for source generated validation from dotnet/aspnetcore#46349.
context.ValidationContext.MemberName = originalMemberName; | ||
if (hasErrors) | ||
{ | ||
return; |
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.
The custom implementation of ValidateAsync for CollectionRuleOptions exists to preserve the short-circuiting behavior here for incorrect use of templates:
dotnet-monitor/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.Validate.cs
Line 24 in cd505c1
return results; |
Without this short-circuiting, we'd get extra errors about a missing Type
field in addition to the bad template reference, which is undesirable because the Type
field should not be set directly if using a template.
Work around dotnet/aspnetcore#61379
- Re-run latest version of generators - Add comments to help point out places where manual changes were made to the generated code
Something was wrong with the previous update (maybe a caching issue). This uses the latest version of the generator.
This uses the new model for source generated validation from dotnet/aspnetcore#46349.
For now this checks in the generated code, with some tweaks to work around the following issues:
and the generator is disabled.
Once those issues are fixed, we can: