{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Error",
    "type": "object",
    "definitions": {
        "code": {
            "title": "Machine readable code",
            "description": "This will be in upper-case and underscore separated, aka ANGRY_SNAKE_CASE",
            "type": "string"
        },
        "message": {
            "title": "Human readable message",
            "description": "Free text",
            "type": "string"
        },
        "path": {
            "title": "Path to the erroneous property",
            "description": "XPath, e.g. /foo/bar",
            "type": "string"
        },
        "part": {
            "properties": {
                "code": {
                    "$ref": "#/definitions/code"
                },
                "message": {
                    "$ref": "#/definitions/message"
                },
                "path": {
                    "$ref": "#/definitions/path"
                }
            }
        }
    },
    "properties": {
        "code": {
            "$ref": "#/definitions/code"
        },
        "message": {
            "$ref": "#/definitions/message"
        },
        "path": {
            "$ref": "#/definitions/path"
        },
        "errors": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/part"
            }
        }
    },
    "required": [
        "code",
        "message"
    ],
    "additionalProperties": false
}