{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-government-portugal/json-schema/open-government-portugal-dataset-page-schema.json",
  "title": "DatasetPage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-government-portugal-organizations-api-openapi.yml#/components/schemas/DatasetPage",
  "properties": {
    "data": {
      "description": "The page data",
      "items": {
        "$ref": "#/$defs/Dataset__read"
      },
      "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": {
    "AccessAudience__read": {
      "properties": {
        "condition": {
          "enum": [
            "yes",
            "no",
            "under_condition"
          ],
          "type": "string"
        },
        "role": {
          "enum": [
            "local_authority_and_administration",
            "company_and_association",
            "private"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "Badge__read": {
      "properties": {
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "BaseReference": {
      "properties": {
        "class": {
          "description": "The object class",
          "type": "string"
        },
        "id": {
          "description": "The object unique identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "ContactPointReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {},
          "type": "object"
        }
      ]
    },
    "Dataset__read": {
      "properties": {
        "access_audiences": {
          "items": {
            "$ref": "#/$defs/AccessAudience__read"
          },
          "type": "array"
        },
        "access_type": {
          "enum": [
            "open",
            "open_with_account",
            "restricted"
          ],
          "type": "string"
        },
        "access_type_reason": {
          "type": "string"
        },
        "access_type_reason_category": {
          "enum": [
            "confidentiality_of_proceedings_of_public_authorities",
            "international_relations_public_security_or_national_defence",
            "course_of_justice_or_fair_trial",
            "confidentiality_of_commercial_or_industrial_information",
            "intellectual_property_rights",
            "confidentiality_of_personal_data",
            "protection_of_voluntary_information_suppliers",
            "protection_of_environment"
          ],
          "type": "string"
        },
        "acronym": {
          "maxLength": 128,
          "type": "string"
        },
        "archived": {
          "format": "date-time",
          "type": "string"
        },
        "authorization_request_url": {
          "type": "string"
        },
        "badges": {
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/Badge__read"
              }
            ],
            "readOnly": true
          },
          "readOnly": true,
          "type": "array"
        },
        "contact_points": {
          "items": {
            "$ref": "#/$defs/ContactPointReference"
          },
          "type": "array"
        },
        "created_at_internal": {
          "format": "date-time",
          "type": "string"
        },
        "deleted": {
          "format": "date-time",
          "type": "string"
        },
        "description": {
          "format": "markdown",
          "type": "string"
        },
        "description_short": {
          "maxLength": 200,
          "type": "string"
        },
        "ext": {
          "type": "object"
        },
        "extras": {
          "type": "object"
        },
        "featured": {
          "type": "boolean"
        },
        "frequency": {
          "enum": [
            "continuous",
            "oneMinute",
            "fiveMinutes",
            "tenMinutes",
            "fifteenMinutes",
            "thirtyMinutes",
            "hourly",
            "bihourly",
            "trihourly",
            "twelveHours",
            "severalTimesADay",
            "threeTimesADay",
            "semidaily",
            "daily",
            "fiveTimesAWeek",
            "threeTimesAWeek",
            "semiweekly",
            "weekly",
            "biweekly",
            "threeTimesAMonth",
            "semimonthly",
            "monthly",
            "bimonthly",
            "quarterly",
            "threeTimesAYear",
            "semiannual",
            "annual",
            "biennial",
            "triennial",
            "quadrennial",
            "quinquennial",
            "decennial",
            "bidecennial",
            "tridecennial",
            "punctual",
            "irregular",
            "never",
            "notPlanned",
            "other",
            "unknown"
          ],
          "type": "string"
        },
        "frequency_date": {
          "format": "date-time",
          "type": "string"
        },
        "harvest": {
          "$ref": "#/$defs/HarvestDatasetMetadata__read"
        },
        "id": {
          "readOnly": true,
          "type": "string"
        },
        "last_modified_internal": {
          "format": "date-time",
          "type": "string"
        },
        "last_update": {
          "format": "date-time",
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "metrics": {
          "readOnly": true,
          "type": "object"
        },
        "organization": {
          "allOf": [
            {
              "$ref": "#/$defs/OrganizationReference"
            }
          ],
          "description": "Only present if owner is not set. Can only be set to an organization of the current authenticated user."
        },
        "owner": {
          "allOf": [
            {
              "$ref": "#/$defs/UserReference"
            }
          ],
          "description": "Only present if organization is not set. Can only be set to the current authenticated user."
        },
        "private": {
          "type": "boolean"
        },
        "quality_cached": {
          "type": "object"
        },
        "resources": {
          "items": {
            "$ref": "#/$defs/Resource__read"
          },
          "type": "array"
        },
        "schema": {
          "$ref": "#/$defs/Schema__read"
        },
        "slug": {
          "maxLength": 255,
          "type": "string"
        },
        "spatial": {
          "$ref": "#/$defs/SpatialCoverage"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "temporal_coverage": {
          "$ref": "#/$defs/TemporalCoverage"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "created_at_internal",
        "description",
        "featured",
        "id",
        "last_modified_internal",
        "last_update",
        "slug",
        "title"
      ],
      "type": "object"
    },
    "GeoJSON": {
      "properties": {
        "coordinates": {
          "description": "The geometry as coordinates lists",
          "items": {
            "type": "object"
          },
          "type": "array"
        },
        "type": {
          "description": "The GeoJSON Type",
          "enum": [
            "Point",
            "LineString",
            "Polygon",
            "MultiPoint",
            "MultiLineString",
            "MultiPolygon"
          ],
          "type": "string"
        }
      },
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object"
    },
    "HarvestDatasetMetadata__read": {
      "properties": {},
      "type": "object"
    },
    "OrganizationPermissions": {
      "properties": {
        "delete": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        },
        "harvest": {
          "type": "boolean"
        },
        "members": {
          "type": "boolean"
        },
        "private": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "OrganizationReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "acronym": {
              "description": "The organization acronym",
              "type": "string"
            },
            "badges": {
              "description": "The organization badges",
              "items": {
                "$ref": "#/$defs/Badge__read"
              },
              "readOnly": true,
              "type": "array"
            },
            "logo": {
              "description": "The organization logo URL",
              "type": "string"
            },
            "logo_thumbnail": {
              "description": "The organization logo thumbnail URL. This is the square (100x100) and cropped version.",
              "type": "string"
            },
            "name": {
              "description": "The organization name",
              "readOnly": true,
              "type": "string"
            },
            "page": {
              "description": "The organization web page URL",
              "readOnly": true,
              "type": "string"
            },
            "permissions": {
              "allOf": [
                {
                  "$ref": "#/$defs/OrganizationPermissions"
                }
              ],
              "readOnly": true
            },
            "slug": {
              "description": "The organization string used as permalink",
              "readOnly": true,
              "type": "string"
            },
            "uri": {
              "description": "The API URI for this organization",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object"
        }
      ]
    },
    "Resource__read": {
      "properties": {
        "metrics": {
          "readOnly": true,
          "type": "object"
        }
      },
      "type": "object"
    },
    "Schema__read": {
      "properties": {},
      "type": "object"
    },
    "SpatialCoverage": {
      "properties": {
        "geom": {
          "allOf": [
            {
              "$ref": "#/$defs/GeoJSON"
            }
          ],
          "description": "A multipolygon for the whole coverage"
        },
        "granularity": {
          "default": "other",
          "description": "The spatial/territorial granularity (full Granularity object if `X-Get-Datasets-Full-Objects` is set, ID of the granularity otherwise)",
          "type": "object"
        },
        "zones": {
          "description": "The covered zones identifiers (full GeoZone objects if `X-Get-Datasets-Full-Objects` is set, IDs of the zones otherwise)",
          "type": "object"
        }
      },
      "type": "object"
    },
    "TemporalCoverage": {
      "properties": {
        "end": {
          "description": "The temporal coverage end date",
          "format": "date-time",
          "type": "string"
        },
        "start": {
          "description": "The temporal coverage start date",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "start"
      ],
      "type": "object"
    },
    "UserReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "avatar": {
              "description": "The user avatar URL",
              "type": "string"
            },
            "avatar_thumbnail": {
              "description": "The user avatar thumbnail URL. This is the square (500x500) and cropped version.",
              "type": "string"
            },
            "first_name": {
              "description": "The user first name",
              "readOnly": true,
              "type": "string"
            },
            "last_name": {
              "description": "The user larst name",
              "readOnly": true,
              "type": "string"
            },
            "page": {
              "description": "The user web page URL",
              "readOnly": true,
              "type": "string"
            },
            "slug": {
              "description": "The user permalink string",
              "readOnly": true,
              "type": "string"
            },
            "uri": {
              "description": "The API URI for this user",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object"
        }
      ]
    }
  }
}