Repository navigation
7.1.7-beta.3
Pre-release
Pre-release
- Fixed: The nested
[FromQuery]fixes (#209 + #211) now also apply to the nativeMicrosoft.AspNetCore.OpenApitransformer and the experimental Swashbuckle DocumentFilter (Issue #213)FluentValidationOperationTransformer(packageMicroElements.AspNetCore.OpenApi.FluentValidation) previously set a nested parameterrequiredfrom the leaf validator alone — ignoring both whether theSetValidator/ChildRuleschain reaches the leaf (#211) and whether every ancestor of the dot-path is required (#209). It now follows the same reachability + ancestor-required rules as the SwashbuckleOperationFilter- The experimental
FluentValidationDocumentFilterno longer copies value constraints onto a flattened nested parameter whose nested validation is not wired from the root validator (#211) GetMethodInfonow resolves the action method fromControllerActionDescriptor(MVC controllers), not only minimal-API endpoint metadata, so the dot-path root type can be resolved for controller actions- NSwag is unaffected (it has no
[FromQuery]parameter flattening)
- Fixed: A validator for a nested type bound via
[FromQuery]was reflected in the OpenAPI document even when it was not wired into the root validator viaSetValidator/ChildRules(Issue #211)FluentValidationOperationFilterresolved the leaf container's validator directly from the registry (byModelMetadata.ContainerType), so a nestedNotEmpty()marked the flattened parameter (e.g.RequiredSubType.SubProperty) asrequiredeven though FluentValidation never validates an unwired child object — the OpenAPI doc claimedrequired, but the API accepted requests without it- Fix: for a flattened nested parameter, nested rules are now applied only when the
SetValidator/ChildRuleschain from the action's root[FromQuery]validator actually reaches the leaf container; otherwise the parameter is left unconstrained, matching runtime behavior - When the root container type cannot be resolved, prior behavior is preserved (no regression for existing nested-parameter scenarios)
- Behavioral change: when no validator is registered for the root
[FromQuery]type (only a leaf/child validator is registered), a flattened nested parameter is now left unconstrained — matching runtime, where no validation runs without a root validator
- Fixed: A required leaf property inside an optional nested type bound via
[FromQuery]was wrongly marked as a required parameter (Issue #209)- The 7.1.1 fix (Issue #162) made nested
[FromQuery]validation match the leaf property name, butFluentValidationOperationFilterthen setrequiredbased solely on the leaf type, ignoring whether the ancestor segment of the dot-path was optional - Because two nested properties of the same leaf type share one schema/validator (e.g.
OptionalSubType.SubPropertyandRequiredSubType.SubProperty), aNotEmpty()on the leaf marked both flattened parameters as required - Fix: a flattened nested parameter is now marked
requiredonly when every ancestor segment of the dot-path is required — resolved from the action's root[FromQuery]type, combining the native schemarequired(e.g. the C#requiredmodifier) with FluentValidationNotNull/NotEmptyrules - Value constraints (e.g.
minLength) still apply to an optional nested parameter when it is provided - When the root container type cannot be resolved, prior behavior is preserved (no regression for existing nested-parameter scenarios)
- The 7.1.1 fix (Issue #162) made nested