Validation problem
Test form and API validation states with a problem-details body.
Keeps the content type within Stubpoint's allowed JSON type while using the RFC 7807 shape.
View payload and cURL
Headers
none
Body
{
"type": "https://stubpoint.dev/problems/validation",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields need attention.",
"errors": {
"email": [
"Enter a valid email address."
],
"quantity": [
"Quantity must be at least 1."
]
}
}
Create with cURL
curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
"body": "{\n \"type\": \"https://stubpoint.dev/problems/validation\",\n \"title\": \"Validation failed\",\n \"status\": 422,\n \"detail\": \"One or more fields need attention.\",\n \"errors\": {\n \"email\": [\"Enter a valid email address.\"],\n \"quantity\": [\"Quantity must be at least 1.\"]\n }\n}",
"content_type": "application/json",
"headers": null,
"methods": [
"POST"
],
"status": 422
}'