{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.argv-flags.dev/parse-result.schema.json",
  "title": "argv-flags ParseResult (JSON)",
  "type": "object",
  "additionalProperties": false,
  "required": ["values", "present", "rest", "unknown", "issues", "ok"],
  "properties": {
    "values": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [
          { "type": "string" },
          { "type": "number" },
          { "type": "boolean" },
          {
            "type": "array",
            "items": { "type": "string" }
          },
          { "type": "null" }
        ]
      }
    },
    "present": {
      "type": "object",
      "additionalProperties": { "type": "boolean" }
    },
    "rest": {
      "type": "array",
      "items": { "type": "string" }
    },
    "unknown": {
      "type": "array",
      "items": { "type": "string" }
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["code", "severity", "message"],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "UNKNOWN_FLAG",
              "MISSING_VALUE",
              "INVALID_VALUE",
              "REQUIRED",
              "DUPLICATE",
              "EMPTY_VALUE"
            ]
          },
          "severity": { "type": "string", "enum": ["error", "warning"] },
          "message": { "type": "string" },
          "flag": { "type": "string" },
          "key": { "type": "string" },
          "value": { "type": "string" },
          "index": { "type": "integer", "minimum": 0 }
        }
      }
    },
    "ok": { "type": "boolean" }
  }
}
