{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/safe-sample-cli-argument-validation.schema.json",
  "title": "dpone GitOps safe sample CLI argument validation",
  "type": "object",
  "required": [
    "schema",
    "errors"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "dpone.safe-sample-cli-argument-validation.v1"
    },
    "errors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/error"
      }
    }
  },
  "$defs": {
    "error": {
      "type": "object",
      "required": [
        "schema",
        "code",
        "stage",
        "severity",
        "message"
      ],
      "additionalProperties": true,
      "properties": {
        "schema": {
          "const": "dpone.error.v1"
        },
        "code": {
          "type": "string",
          "pattern": "^DPONE_[A-Z0-9_]+$"
        },
        "stage": {
          "const": "safe_sample_cli_arguments"
        },
        "severity": {
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "entity": {
          "type": "object",
          "additionalProperties": true
        },
        "fixes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "safety",
              "description"
            ],
            "additionalProperties": true,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "safety": {
                "enum": [
                  "safe",
                  "manual",
                  "destructive"
                ]
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "command": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        }
      }
    }
  }
}
