{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://apidocs.iqrf.org/openapi/iqrf-gateway-webapp/latest/schemas/error.json",
    "type": "object",
    "title": "Error message",
    "required": [
        "status",
        "code",
        "message"
    ],
    "additionalProperties": false,
    "properties": {
        "status": {
            "type": "string",
            "const": "error",
            "title": "Status",
            "example": "error"
        },
        "code": {
            "type": "integer",
            "title": "Error code",
            "example": 400
        },
        "context": {
            "type": "object",
            "title": "Error context",
            "additionalProperties": true,
            "properties": {
                "type": {
                    "type": "string",
                    "title": "Error type",
                    "enum": [
                        "acme-problem",
                        "acme-unavailable",
                        "invalid-data",
                        "invalid-email-address",
                        "invalid-syntax",
                        "resource-conflict",
                        "resource-gone",
                        "resource-not-found",
                        "totp-code-incorrect",
                        "totp-code-required"
                    ],
                    "example": "invalid-data"
                },
                "resource": {
                    "type": "string",
                    "title": "Name of the resource (only for the resource-conflict, resource-gone and resource-not-found error types)",
                    "example": "user"
                },
                "property": {
                    "type": "string",
                    "title": "Name of the conflicting resource property (only for the resource-conflict error type, optional)",
                    "example": "username"
                },
                "problem": {
                    "type": "string",
                    "title": "ACME problem type without the urn:ietf:params:acme:error: prefix (only for the acme-problem error type)",
                    "example": "rateLimited"
                }
            }
        },
        "message": {
            "type": "string",
            "title": "Error message",
            "example": "Invalid JSON syntax"
        }
    }
}
