{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "input": {
      "type": "object",
      "properties": {
        "files": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "files"
      ],
      "additionalProperties": false
    },
    "validation": {
      "type": "object",
      "properties": {
        "schema": {
          "type": "string"
        },
        "strict": {
          "type": "boolean"
        },
        "resolve_external_refs": {
          "type": "boolean"
        },
        "allow_unknown_extensions": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "execution_profiles": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "default": {
            "type": "boolean"
          },
          "command_sets": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "command": {
                  "type": "string"
                }
              },
              "required": [
                "command"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "command_sets"
        ],
        "additionalProperties": false
      }
    },
    "generators": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "output": {
            "type": "string"
          },
          "templates": {
            "type": "string"
          },
          "options": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "enabled",
          "output",
          "templates"
        ],
        "additionalProperties": false
      }
    },
    "contract_tests": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "profile": {
          "type": "string"
        },
        "cases_dir": {
          "type": "string"
        },
        "timeout_ms": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "validate_stdout": {
          "type": "boolean"
        },
        "validate_stderr": {
          "type": "boolean"
        },
        "validate_files": {
          "type": "boolean"
        },
        "env": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "diff": {
      "type": "object",
      "properties": {
        "breaking_change_policy": {
          "type": "string"
        },
        "ignore": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false,
  "title": "CLI Contracts Config",
  "description": "Schema for cli-contracts.config.yaml — tooling configuration for validation, generation, and testing."
}
