{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.prisme-donnees.fr/depenses-publiques/schemas/document.schema.json",
  "title": "Document cité par le registre",
  "type": "object",
  "required": [
    "id",
    "type",
    "producteur",
    "titre",
    "date_publication",
    "url",
    "consulte_le",
    "droits"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]*$"
    },
    "type": {
      "type": "string",
      "enum": [
        "rapport_evaluation",
        "rapport_public",
        "rapport_parlementaire",
        "document_budgetaire",
        "communique",
        "note_etude",
        "texte_juridique",
        "page_web"
      ]
    },
    "producteur": {
      "type": "string",
      "minLength": 1
    },
    "auteurs": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "titre": {
      "type": "string",
      "minLength": 1
    },
    "date_publication": {
      "type": "string",
      "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
    },
    "url": {
      "type": "string",
      "pattern": "^https://"
    },
    "url_fichier": {
      "type": "string",
      "pattern": "^https://"
    },
    "consulte_le": {
      "type": "string",
      "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
    },
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "pages": {
      "type": "integer",
      "minimum": 1
    },
    "droits": {
      "type": "string",
      "minLength": 1
    },
    "note": {
      "type": "string"
    }
  }
}
