Repository navigation
Not taking into account childRules when they point to the same property - #235
Merged
avgalex merged 2 commits intoOct 31, 2026
Merged
Conversation
Do not promote NotNull and NotEmpty inside null-skipping child validators into required parent properties. Keep non-empty length constraints and explicit parent presence rules across all three OpenAPI backends. Add regression coverage for nullable properties, arrays, collection items, nested identity rules, and stronger parent length constraints. Prepare version 7.2.3 and update the changelog. Validation: 569 tests passed in Release across supported target frameworks; Release solution build and four 7.2.3 packages verified locally.
Member
|
Thanks for the fix and for testing it in your application! During review, I found one edge case: FluentValidation skips child validators when the parent value is I pushed a follow-up fix to this PR. It preserves nullable/optional properties while retaining Added regression coverage across all three OpenAPI backends. All 569 tests pass locally, including 55 new checks. The version and changelog are prepared for 7.2.3. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes missing OpenAPI constraints when a property uses ChildRules with an identity rule such as:
Previously, the library did not associate the identity child rule with its owning property, so the regex pattern was missing from the generated schema.
Changes
• Apply identity child-rule constraints to the owning property or collection item.
• Support nested identity validators while preventing recursive traversal.
• Respect existing rule filters and conditional-rule settings.
• Preserve parent constraints when a runtime-dependent child validator cannot be resolved.
• Update the changelog and add regression tests.
Runtime validation remains unchanged. Extensions can continue accepting IRuleBuilder<T, string> anywhere in the pipeline, and schema generation does not execute Must predicates or repository lookups.
Validation
• All 514 tests passed across supported target frameworks.
• Solution build succeeded.ç
@avgalex. I have tested on my own machine with a local nuget and it works for my scenario.
I have changed an App from CascadeMode.Stop to Continue globally and an extension method I had does 2 validations, the first is almost Nop(Regex) check. The second one is a call to a repository