Validation errors
Request validation in its common styles: /register — hand-written rules, 422 application/problem+json (RFC 7807) with per-field errors. /strict — rejects unknown fields (400) as well as invalid ones (422). /annotations — DataAnnotations model; [ApiController] produces the framework's automatic 400. /problem/{type} — sample problem documents for each common error status. Nothing is stored, so the same payload always gets the same answer.
Your account unlocks these endpoints. Try it on each endpoint's page sends your key for you; from your own code, send a key from your API keys page in the X-TestingApis-Key header.
These endpoints need a free account. Create one or sign in to see their details and try them here.
- POST
https://api.testingapis.com/api/validation/annotationsValidate a DataAnnotations model using the framework's automatic 400Validate a DataAnnotations model using the framework's automatic 400. - GET
https://api.testingapis.com/api/validation/problemList the sample problem document typesList the sample problem document types. - GET
https://api.testingapis.com/api/validation/problem/{type}Get a sample RFC 7807 problem documentGet a sample RFC 7807 problem document. - POST
https://api.testingapis.com/api/validation/registerRegister a userRegister a user; invalid fields return 422 problem+json. - POST
https://api.testingapis.com/api/validation/strictAccept only known fieldsAccept only known fields; unknown fields return 400.
Example request
List the sample problem document types. Full reference and a Send button.
curl -X GET "https://api.testingapis.com/api/validation/problem" \
-H "X-TestingApis-Key: YOUR_API_KEY"[
{"type": "bad-request", "status": 400, "url": "/api/validation/problem/bad-request"},
{"type": "unauthorized", "status": 401, "url": "/api/validation/problem/unauthorized"},
"… 8 more items"
]Sign in to see the details
The parameters, request and response examples and the live Try it panel for these endpoints are for signed-in members. Accounts are free and take a few seconds to create.