{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.prisme-donnees.fr/depenses-publiques/schemas/corrections.schema.json",
  "title": "Journal public des corrections",
  "type": "object",
  "required": [
    "corrections"
  ],
  "additionalProperties": false,
  "properties": {
    "corrections": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "date",
          "pages",
          "avant",
          "apres",
          "cause",
          "signale_par"
        ],
        "additionalProperties": false,
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^/"
            },
            "minItems": 1
          },
          "avant": {
            "type": "string",
            "minLength": 1
          },
          "apres": {
            "type": "string",
            "minLength": 1
          },
          "cause": {
            "type": "string",
            "minLength": 1
          },
          "signale_par": {
            "type": "string",
            "minLength": 1
          },
          "gravite": {
            "type": "string",
            "enum": [
              "chiffre",
              "formulation",
              "niveau_de_preuve",
              "regle",
              "coquille"
            ]
          }
        }
      }
    }
  }
}
