Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
How difficult can this be
Checkbox in html form when its not true, simply not to submit the value in the property
public record PostParameter([Required][EmailAddress] string Email, [Required][MinLength(8)] string Password, string? RememberMe = "unchecked");
internal static async Task<Results<RedirectHttpResult, BadRequest>> Post(HttpContext httpContext, [FromForm] PostParameter parameter)
PostParameter has optional parameter but that optional parameter is not respected
BadHttpRequestException: Missing required value for constructor parameter 'RememberMe'.
Microsoft.AspNetCore.Http.RequestDelegateFactory+Log.FormDataMappingFailed(HttpContext httpContext, string parameterTypeName, string parameterName, FormDataMappingException exception, bool shouldThrow)
Expected Behavior
should simply accept (no exception) when client not sending "RememberMe" in the payload
Steps To Reproduce
No response
Exceptions (if any)
FormDataMappingException
.NET Version
8
Anything else?
No response