{
  "$schema":     "http://json-schema.org/draft-04/schema#",
  "title":       "Catalog",
  "description": "Serialization of the Puppet catalog for a given node",
  "type":        "object",
  "properties": {
    "catalog": {
      "type": "object",
      "$ref": "https://docs.openvoxproject.org/openvox/latest/schemas/catalog.json"
    },
    "logs": {
      "description": "The log messages that occured during the catalog compilation.",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "#/definitions/log"
      }
    }
  },
  "required": ["catalog"],
  "additionalProperties": false,

  "definitions" : {
    "log" : {
      "properties": {
        "file": {
          "description": "The pathname of the manifest file which triggered the log message.",
          "oneOf":       [
            {"type": "string"},
            {"type": "null"}
          ]
        },
        "line": {
          "description": "The line number in the manifest file which triggered the log message.",
          "oneOf":       [
            {"type": "string"},
            {"type": "null"}
          ]
        },
        "level": {
          "description": "The severity of the message.",
          "enum": [
            "debug",
            "info",
            "notice",
            "warning",
            "err",
            "alert",
            "emerg",
            "crit"
          ]
        },
        "message": {
          "description": "The message itself.",
          "type":        "string"
        },
        "source": {
          "description": "The origin of the log message. This could be a resource, a property of a resource, or the string 'Puppet'.",
          "type":        "string"
        },
        "tags": {
          "description": "The strings with which the source is tagged",
          "type":        "array",
          "items":       { "type": "string" }
        },
        "time": {
          "description": "When the message was sent. In ISO 8601 format with 9 characters second-fragment",
          "type":        "string"
        }
      }
    },
    "required": [
      "level",
      "message",
      "source",
      "tags",
      "time"
    ],
    "additionalProperties": false
  }
}
