{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lebaneselegislation-com/json-schema/lebaneselegislation-com-law-list-schema.json",
  "title": "LawList",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lebaneselegislation-com-openapi.json#/components/schemas/LawList",
  "type": "object",
  "required": [
    "since",
    "until",
    "kind",
    "order",
    "total",
    "laws"
  ],
  "properties": {
    "since": {
      "type": [
        "string",
        "null"
      ]
    },
    "until": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": [
        "string",
        "null"
      ]
    },
    "order": {
      "type": "string",
      "enum": [
        "newest",
        "oldest"
      ]
    },
    "total": {
      "type": "integer"
    },
    "next_cursor": {
      "type": "string",
      "description": "Pass it as cursor for the next page; absent on the last page."
    },
    "laws": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/LawSummary"
          },
          {
            "type": "object",
            "properties": {
              "gazette_number": {
                "type": "string"
              },
              "gazette_date": {
                "$ref": "#/$defs/Date"
              },
              "gazette_issue_id": {
                "type": "integer"
              },
              "date": {
                "$ref": "#/$defs/Date",
                "description": "The Gazette date, else the text's date: what since, until and order use."
              }
            }
          }
        ]
      }
    }
  },
  "$defs": {
    "Date": {
      "type": "string",
      "format": "date"
    },
    "LawSummary": {
      "type": "object",
      "description": "A text's identity, without its text.",
      "required": [
        "id",
        "kind",
        "title",
        "status",
        "article_count",
        "url"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "kind": {
          "type": "string",
          "description": "In Arabic, as the Centre names it."
        },
        "kind_en": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "issued_on": {
          "$ref": "#/$defs/Date"
        },
        "title": {
          "type": "string",
          "description": "The official Arabic title."
        },
        "title_en": {
          "type": "string",
          "description": "Unofficial English title, written by a model from the Arabic title."
        },
        "status": {
          "type": "string",
          "enum": [
            "in_force",
            "repealed"
          ]
        },
        "article_count": {
          "type": "integer"
        },
        "code": {
          "type": "string",
          "description": "The curated code's short name, e.g. \"Code of Obligations and Contracts\"."
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "updated_at": {
          "$ref": "#/$defs/UpdatedAt"
        }
      }
    },
    "UpdatedAt": {
      "type": "string",
      "format": "date",
      "description": "The day the record's page last changed on the site (page_state): an amendment in force, a ruling's reading, a correction. Never the text's own date. Absent when not known."
    }
  }
}