You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I send data with Guid.Empty, the validator success validation instead of fail validation.
Reproduction Steps
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
namespace WebApplication2.Controllers;
[ApiController]
[Route("[controller]")]
public class FooController : ControllerBase
{
[HttpPost]
public FooModel Foo([FromBody] FooModel fooModel)
{
return fooModel;
}
}
public class FooModel
{
[Required(AllowEmptyStrings = false, DisallowAllDefaultValues = true)]
public Guid? Id { get; set; }
}
Expected behavior
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"Id": [
"The Id field is required."
]
},
"traceId": "00-b7dcd87be3c66cde040e34fc685d4c7a-6a1eb125481c8a9f-00"
}
Actual behavior
{
"id": "00000000-0000-0000-0000-000000000000"
}
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
when I send data with Guid.Empty, the validator success validation instead of fail validation.
Reproduction Steps
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
namespace WebApplication2.Controllers;
[ApiController]
[Route("[controller]")]
public class FooController : ControllerBase
{
[HttpPost]
public FooModel Foo([FromBody] FooModel fooModel)
{
return fooModel;
}
}
public class FooModel
{
[Required(AllowEmptyStrings = false, DisallowAllDefaultValues = true)]
public Guid? Id { get; set; }
}
Expected behavior
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"Id": [
"The Id field is required."
]
},
"traceId": "00-b7dcd87be3c66cde040e34fc685d4c7a-6a1eb125481c8a9f-00"
}
Description
when I send data with Guid.Empty, the validator success validation instead of fail validation.
Reproduction Steps
Expected behavior
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: