Skip to main content
CuteJSON
↑↓ Navigate Enter Select Esc Close

Error Response Schema

Intermediate JSON Schema

A JSON Schema for validating API error responses with structured error details. A realistic fixture for your own project or test suite.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ErrorResponse",
  "type": "object",
  "properties": {
    "status": { "const": "error" },
    "error": {
      "type": "object",
      "properties": {
        "code": { "type": "string" },
        "message": { "type": "string" },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "field": { "type": "string" },
              "message": { "type": "string" }
            }
          }
        }
      },
      "required": ["code", "message"]
    },
    "requestId": { "type": "string" }
  },
  "required": ["status", "error"]
}
JSON Examples