C
Join ServerC#
help
❔ ModelState.IsValid
SSimo12/23/2022
do I need to call this explicitly myself or does the framework call this when using webAPI?
I would assume that its called automatically but its still possible for the JSON to end up de-serialized but still not be valid?
I would assume that its called automatically but its still possible for the JSON to end up de-serialized but still not be valid?
DDeluxe12/23/2022
controllers marked with
[ApiController]
automatically check this and return a bad requestSSimo12/23/2022
thank you! that clears it up
SSimo12/23/2022
that explains this type of response then:
{
"errors": {
"EmailAddress": [
"The EmailAddress field is required."
]
},
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-eba25af423d72cafb9cd245658d426c4-18ed1876309cd757-01"
}
AAccord12/24/2022
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.