{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "required": [
        "statusCode",
        "reasonPhrase"
    ],
    "additionalProperties": false,
    "properties": {
        "statusCode": {
            "type": "integer"
        },
        "reasonPhrase": {
            "type": "string"
        },
        "message": {
            "type": "string"
        },
        "details": {},
        "stackTrace": {
            "$ref": "#/definitions/exception"
        }
    },
    "definitions": {
        "exception": {
            "type": "object",
            "required": [
                "type"
            ],
            "properties": {
                "type": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "at": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "suppressed": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/maybeCircularException"
                    }
                },
                "causedBy": {
                    "$ref": "#/definitions/maybeCircularException"
                }
            }
        },
        "circularReference": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "circularReference"
            ],
            "properties": {
                "circularReference": {
                    "$ref": "#/definitions/exception"
                }
            }
        },
        "maybeCircularException": {
            "oneOf": [
                {
                    "$ref": "#/definitions/exception"
                },
                {
                    "$ref": "#/definitions/circularReference"
                }
            ]
        }
    }
}