{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-government-portugal/json-schema/open-government-portugal-topic-element-page-schema.json",
  "title": "TopicElementPage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-government-portugal-topics-api-openapi.yml#/components/schemas/TopicElementPage",
  "properties": {
    "data": {
      "description": "The page data",
      "items": {
        "$ref": "#/$defs/TopicElement"
      },
      "type": "array"
    },
    "next_page": {
      "description": "The next page URL if exists",
      "type": "string"
    },
    "page": {
      "description": "The current page",
      "minimum": 1,
      "type": "integer"
    },
    "page_size": {
      "description": "The page size used for pagination",
      "minimum": 0,
      "type": "integer"
    },
    "previous_page": {
      "description": "The previous page URL if exists",
      "type": "string"
    },
    "total": {
      "description": "The total paginated items",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "page",
    "page_size",
    "total"
  ],
  "type": "object",
  "$defs": {
    "ModelReference": {
      "properties": {
        "class": {
          "description": "The model class",
          "type": "string"
        },
        "id": {
          "description": "The object identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "TopicElement": {
      "properties": {
        "description": {
          "description": "The element description",
          "type": "string"
        },
        "element": {
          "allOf": [
            {
              "$ref": "#/$defs/ModelReference"
            }
          ],
          "description": "The element target object"
        },
        "extras": {
          "description": "Extras attributes as key-value pairs",
          "type": "object"
        },
        "id": {
          "description": "The element id",
          "type": "string"
        },
        "tags": {
          "description": "The element tags",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "title": {
          "description": "The element title",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}