How to use Mock Error Response Generator
- Select the error kind and the format your API uses.
- For validation errors, list the field names.
- Generate and paste the body into your client tests or mock server.
Mock Error Response Generator features
- Eleven formats: RFC 9457, JSON:API, Google, AWS, Stripe, Laravel, Django REST, ASP.NET Core, JSend, simple and GraphQL
- Eleven error kinds from validation (422) to gateway timeout (504) with matching headers
- Field-level messages inferred from field names
- Custom detail message override
- Raw HTTP output plus a status and header summary
Mock Error Response Generator example
Laravel-style validation error
Input:
Fields: email, age
Error: validation, format: LaravelOutput:
HTTP/1.1 422 Unprocessable Content
{
"message": "Email must be a valid email address.",
"errors": {
"email": ["Email must be a valid email address."],
"age": ["Age must be between 1 and 100."]
}
}Frequently asked questions about Mock Error Response Generator
Which formats are available?
RFC 9457 Problem Details, JSON:API errors, Google API, AWS, Stripe, Laravel, Django REST Framework, ASP.NET Core ValidationProblemDetails, JSend, a simple { error } object and GraphQL errors.
Which error kinds can I generate?
Validation (422), bad request (400), authentication (401), forbidden (403), not found (404), conflict (409), payment required (402), rate limit (429), server error (500), unavailable (503) and gateway timeout (504) — each with matching headers.
How are field errors chosen?
From the field names: email gets an invalid-format message, password too-short, terms must-be-true, ids not-found, and so on. Add your own fields to see the mapping.
Can I set the message?
Yes, the custom message replaces the default detail in every format while codes, status and structure stay correct.