Skip to content

Release 7.1.6#207

Merged
avgalex merged 15 commits into
masterfrom
release/v7.1.6-beta
Jun 2, 2026
Merged

Release 7.1.6#207
avgalex merged 15 commits into
masterfrom
release/v7.1.6-beta

Conversation

@avgalex
Copy link
Copy Markdown
Member

@avgalex avgalex commented Jun 2, 2026

Promote 7.1.6 to stable (from release/v7.1.6-beta). Supersedes the unreleased 7.1.5 betas.

Included

  • Fixed: $ref replaced with an inline copy / orphaned child component when nested constraints come from ChildRules or an inline child validator (#198, #206).
  • Added: ConditionalRulesMode for .When()/.Unless() rules (#203).
  • Fixed: Multiple .Matches() rules on one property rendered incorrectly; now combined into a single pattern via lookahead (#204, #205). Default of UseAllOfForMultipleRules changed truefalse.

Tests green on net8.0/net9.0/net10.0. Merging to master publishes 7.1.6 to NuGet.

avgalex and others added 15 commits April 1, 2026 13:29
… generation (Issue #203)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… docs, extract test file

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ent-level test

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…omponent-level and custom RuleFilter tests

Warning logging now happens inside the RuleFilter/RuleComponentFilter conditions
created by FillDefaultValues. This ensures:
- No spurious warnings when user sets a custom RuleFilter
- No LINQ scan inside the 4-level nested loop in ApplyRulesToSchema

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Multiple .Matches() rules on one property were placed into separate
allOf subschemas, which Swagger UI/Redoc/Scalar collapse — keeping only
the first pattern and duplicating the property.

Now multiple patterns are combined into a single 'pattern' via lookahead
assertions, preserving .Matches() semantics (Regex.IsMatch — "contains a
match") and rendering correctly in all tools.

- Add PatternCombiner helper in MicroElements.OpenApi.FluentValidation
- Apply in Swashbuckle, AspNetCore.OpenApi and NSwag rule providers
  (NSwag previously kept only the last pattern)
- Change SchemaGenerationOptions.UseAllOfForMultipleRules default
  true -> false; set true to keep the legacy allOf representation
- Add unit and integration tests

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- PatternCombiner.Combine: guard against null/empty newPattern
- Document the accepted edge case in the LookaheadPrefix detection heuristic
- Note in UseAllOfForMultipleRules XML doc that NSwag always combines patterns
- Assert the combined pattern in the existing multiple_match_rules test

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tches-pattern

Fix multiple .Matches() rules displayed incorrectly (Issue #204)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 7.1.3 fix (SnapshotRefs + RestoreUnmodifiedRefs) restored unmodified
$refs, but when a nested object's constraints come from ChildRules (or any
inline child validator) the child type has no standalone validator, so its
component schema is generated empty and gains its Required only AFTER the
parent's inline snapshot is taken. The stale Required on the inline copy then
diverged from the component and defeated HasValidationConstraintChanges,
leaving an inline copy and an orphaned child component.

Fix: make the Required comparison in HasValidationConstraintChanges
directional — only block ref restoration when the inline copy carries a
required entry the component lacks (the copy is authoritative for it).
SetValidator (with a standalone child validator) was already correct;
BigInteger/enum per-model constraints (Issues #146/#176) continue to work.

Add regression tests for ChildRules-inline and multi-constraint SetValidator
nested objects.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… tests

Per the PR review, both tests now also assert:
- Name gets maxLength=510 (not just Email format=email)
- the child component's Required contains {Email, Name} — the exact set the
  orphan bug used to drop

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…inline-ref

Fix $ref orphaned with ChildRules/inline child validator (Issue #198)
7.1.6 supersedes the unreleased 7.1.5 betas. The CHANGELOG section now
bundles all shipped changes: #198 (ChildRules/inline-validator $ref orphan),
#203 (ConditionalRulesMode), #204 (multiple .Matches()).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avgalex avgalex merged commit 2ee3c55 into master Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant