मुख्य सामग्री पर जाएं
CuteJSON
↑↓ नेविगेट करें Enter चुनें Esc बंद करें

त्रुटि प्रतिक्रिया Schema

मध्यम JSON Schema

संरचित त्रुटि विवरण के साथ API त्रुटि प्रतिक्रियाओं को सत्यापित करने के लिए एक JSON Schema। कॉपी करने के लिए तैयार।

{
  "$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 उदाहरण