{
    "$schema": "http://json-schema.org/draft-04/schema",
    "title": "This document describes the structure of engine output",
    "description": "Engine output is an array of analysis results",
    "type": "array",
    "items": {
        "$ref": "#/definitions/result"
    },
    "definitions": {
        "result": {
            "type": "object",
            "description": "Represents analysis result",
            "properties": {
                "path": {
                    "type": "string",
                    "description": "The path relative to the analysis root"
                },
                "messages": {
                    "type": "array",
                    "description": "List of messages in the path",
                    "items": {
                        "$ref": "#/definitions/message"
                    }
                }
            },
            "required": [
                "path",
                "messages"
            ]
        },
        "message": {
            "type": "object",
            "description": "Represents analysis message",
            "properties": {
                "message": {
                    "type": "string",
                    "description": "The short description of the message"
                },
                "description": {
                    "type": "string",
                    "description": "The explanatory text of the message"
                },
                "severity": {
                    "type": "string",
                    "description": "The severity of the message",
                    "enum": [
                        "verbose",
                        "hint",
                        "information",
                        "warning",
                        "error"
                    ]
                },
                "line": {
                    "type": "integer",
                    "description": "The line where the message is located",
                    "minimum": 0
                },
                "lineEnd": {
                    "type": "integer",
                    "description": "The end line where the message is located (the same as line by default)",
                    "minimum": 0
                },
                "column": {
                    "type": "integer",
                    "description": "The column where the message is located",
                    "minimum": 0
                },
                "columnEnd": {
                    "type": "integer",
                    "description": "The end column where the message is located",
                    "minimum": 0
                },
                "ruleId": {
                    "type": "string",
                    "description": "The id of the rule that produced the message"
                },
                "ruleName": {
                    "type": "string",
                    "description": "The name of the rule that produced the message"
                },
                "ruleNs": {
                    "type": "string",
                    "description": "The namespace of the rule that produced the message"
                }
            },
            "required": [
                "message",
                "severity",
                "line"
            ]
        }
    }
}