{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/legalize-dev/json-schema/legalize-dev-paginated-laws-schema.json",
  "title": "PaginatedLaws",
  "description": "Unified response for law listing and search.\n\nWhen searching (query is not None), both ``total`` and ``count``\nare populated with the same value for backward compatibility.\nWhen listing, ``query`` and ``count`` are None.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/legalize-dev-openapi.yml#/components/schemas/PaginatedLaws",
  "properties": {
    "country": {
      "type": "string",
      "title": "Country"
    },
    "total": {
      "type": "integer",
      "title": "Total"
    },
    "page": {
      "type": "integer",
      "title": "Page"
    },
    "per_page": {
      "type": "integer",
      "title": "Per Page"
    },
    "jurisdiction": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Jurisdiction"
    },
    "query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Query"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Count"
    },
    "sort": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sort"
    },
    "from_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "From Date"
    },
    "to_date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "To Date"
    },
    "results": {
      "items": {
        "$ref": "#/$defs/LawSearchResult"
      },
      "type": "array",
      "title": "Results"
    }
  },
  "type": "object",
  "required": [
    "country",
    "total",
    "page",
    "per_page",
    "results"
  ],
  "$defs": {
    "LawSearchResult": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "short_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Short Title"
        },
        "country": {
          "type": "string",
          "title": "Country"
        },
        "law_type": {
          "type": "string",
          "title": "Law Type"
        },
        "publication_date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Publication Date"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        },
        "jurisdiction": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Jurisdiction"
        },
        "article_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Article Count"
        },
        "text_state": {
          "type": "string",
          "title": "Text State",
          "default": "point_in_time"
        },
        "reform_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reform Count"
        },
        "text_superseded": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text Superseded"
        },
        "title_snippet": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title Snippet"
        },
        "match_basis": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "identifier",
                "text"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Match Basis"
        },
        "content_availability": {
          "type": "string",
          "const": "unchecked",
          "title": "Content Availability",
          "default": "unchecked"
        },
        "articles_indexed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Articles Indexed",
          "description": "Metadata counts do not establish an index in the currently served body.",
          "readOnly": true
        }
      },
      "type": "object",
      "required": [
        "id",
        "title",
        "country",
        "law_type",
        "articles_indexed"
      ],
      "title": "LawSearchResult",
      "description": "Law result with search snippet."
    }
  }
}