{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "daggry/result@1",
  "title": "daggry/result@1: the result document a check writes",
  "type": "object",
  "required": [
    "format",
    "outcome"
  ],
  "additionalProperties": false,
  "patternProperties": {
    "^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$": true
  },
  "properties": {
    "format": {
      "const": "daggry/result@1"
    },
    "outcome": {
      "enum": [
        "pass",
        "fail",
        "error"
      ]
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "outcome",
          "message"
        ],
        "additionalProperties": false,
        "patternProperties": {
          "^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$": true
        },
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "outcome": {
            "enum": [
              "pass",
              "fail",
              "error",
              "skip"
            ]
          },
          "locator": {
            "type": "string",
            "minLength": 1
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "metrics": {
      "type": "object",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9_]*$"
      },
      "additionalProperties": {
        "type": "number"
      }
    }
  }
}
