{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apigenie.pl/schemas/apigenie-init-report.json",
  "title": "apigenie init --json",
  "description": "What `apigenie init --json` wrote into a repository (ADR-201): the configuration file and the instructions of coding agents, and the API descriptions it found. Adding members keeps formatVersion; removing a member or changing its meaning or type increments it.",
  "type": "object",
  "required": ["formatVersion", "root", "dryRun", "files", "specifications"],
  "properties": {
    "formatVersion": {
      "description": "The version of this format.",
      "const": 1
    },
    "root": {
      "description": "The repository: the directory of the configuration file the other commands read from the directory given, else the root of the git repository holding it, else that directory: relative to the current directory when that is in the repository, else absolute.",
      "type": "string"
    },
    "dryRun": {
      "description": "Whether the run was --dry-run, which writes nothing: the outcomes are what would have happened.",
      "type": "boolean"
    },
    "files": {
      "description": "The configuration file, then the instructions file of coding agents.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "outcome"],
        "properties": {
          "path": {
            "description": "The file: relative to the current directory when that is in the repository, else absolute.",
            "type": "string"
          },
          "outcome": {
            "description": "created: the file was written; updated: the agents' section was appended to it; kept: it was there (a configuration file, or instructions with the section) and is left as it is; skipped: --no-agents.",
            "enum": ["created", "updated", "kept", "skipped"]
          }
        }
      }
    },
    "specifications": {
      "description": "The API descriptions found in the repository, ordered by path, as apigenie-catalog finds them.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "format"],
        "properties": {
          "path": {
            "description": "Relative to the repository, '/'-separated.",
            "type": "string"
          },
          "format": {
            "enum": ["openapi", "asyncapi", "swagger", "protobuf", "graphql"]
          },
          "formatVersion": {
            "description": "The `openapi`, `asyncapi` or `swagger` property, or the Protobuf syntax; absent for GraphQL.",
            "type": "string"
          }
        }
      }
    }
  }
}
