-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bughelp-wantedA change up for grabs for contributions from the communityA change up for grabs for contributions from the community
Description
Describe the bug
Consider the following model:
public record Model ( Inner? inner, [Required] string other );
public record Inner ( [Required] string prop );
The model is used in an ASP.NET Core action like this:
public IActionResult MyAction ( [FromForm, Required] Model model )
It translates the nested models to a flattened representation of dot-concatenated properties, i.e., inner.prop
- unfortunately, this property is set to required which is not true.
Expected behavior
The property should be optional.
Actual behavior
The property is marked as required.
Steps to reproduce
See description.
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
8
.NET Version
8
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bughelp-wantedA change up for grabs for contributions from the communityA change up for grabs for contributions from the community