{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://apigenie.pl/schemas/apigenie-status-report.json",
  "title": "The status of a command run with --json",
  "description": "What a command of apigenie, apigenie-generator, apigenie-catalog or apigenie-server run with --json prints when it has no report of its own (or can't write one, such as after a usage error): its exit status, the messages it reported and the text it would have printed on the standard output. Adding members keeps formatVersion; removing a member or changing its meaning or type increments it.",
  "type": "object",
  "required": ["formatVersion", "command", "exitStatus", "messages"],
  "properties": {
    "formatVersion": {
      "description": "The version of this format.",
      "const": 1
    },
    "command": {
      "description": "The binary and its subcommands, such as `apigenie config check` or `apigenie-generator client go`; only as far as the command line could be parsed when it couldn't.",
      "type": "string"
    },
    "exitStatus": {
      "description": "The exit status of the process: 0 success, 1 findings (lint errors, breaking changes, ...), 2 an error (bad options, a file that can't be read, ...), and the others of https://apigenie.pl/docs/reference/cli/compatibility.",
      "type": "integer"
    },
    "messages": {
      "description": "The lines of the errors and warnings the command reported, in order, as it also wrote them to the standard error, without colors.",
      "type": "array",
      "items": { "type": "string" }
    },
    "output": {
      "description": "What the command would have written to the standard output without --json, such as a converted document; absent when nothing.",
      "type": "string"
    }
  }
}
