{
  "$defs": {
    "QualityWarning": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "pattern": "^[A-Z][A-Z0-9_]{1,63}$",
          "title": "Code",
          "type": "string"
        },
        "coords": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": "Coords",
          "type": "object"
        },
        "message_plain": {
          "maxLength": 500,
          "title": "Message Plain",
          "type": "string"
        },
        "severity": {
          "default": "warning",
          "enum": [
            "info",
            "warning",
            "error"
          ],
          "title": "Severity",
          "type": "string"
        },
        "suggested_action": {
          "anyOf": [
            {
              "maxLength": 500,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suggested Action"
        },
        "var": {
          "anyOf": [
            {
              "maxLength": 256,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Var"
        }
      },
      "required": [
        "code",
        "message_plain"
      ],
      "title": "QualityWarning",
      "type": "object"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/explore-quality.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": true,
  "description": "``quality``: data-quality warnings in plain words (gaps, constant columns, negative\nspend, duplicated periods, short history, outliers, collinear drivers).",
  "properties": {
    "caption_plain": {
      "anyOf": [
        {
          "maxLength": 1000,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Caption Plain"
    },
    "format": {
      "const": "mapi.data-explorer.quality/v1",
      "default": "mapi.data-explorer.quality/v1",
      "title": "Format",
      "type": "string"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/QualityWarning"
      },
      "maxItems": 500,
      "title": "Items",
      "type": "array"
    },
    "node": {
      "anyOf": [
        {
          "pattern": "^/(?:[A-Za-z_][A-Za-z0-9_.\\-]{0,63}(?:/[A-Za-z_][A-Za-z0-9_.\\-]{0,63}){0,7})?$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "M4: the node of a tree dataset the view describes (absent for a flat dataset)",
      "title": "Node"
    },
    "warnings_plain": {
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "title": "Warnings Plain",
      "type": "array"
    }
  },
  "title": "QualityView",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
