{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-government-portugal/json-schema/open-government-portugal-dataservice-page-schema.json",
  "title": "DataservicePage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-government-portugal-dataservices-api-openapi.yml#/components/schemas/DataservicePage",
  "properties": {
    "data": {
      "description": "The page data",
      "items": {
        "$ref": "#/$defs/Dataservice__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"
    },
    "ContactPoint__read": {
      "properties": {
        "contact_form": {
          "type": "string"
        },
        "email": {
          "maxLength": 255,
          "type": "string"
        },
        "id": {
          "readOnly": true,
          "type": "string"
        },
        "name": {
          "maxLength": 255,
          "type": "string"
        },
        "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."
        },
        "role": {
          "enum": [
            "contact",
            "creator",
            "publisher",
            "rightsHolder",
            "custodian",
            "distributor",
            "originator",
            "principalInvestigator",
            "processor",
            "resourceProvider",
            "user"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "role"
      ],
      "type": "object",
      "x-mask": "{id,name,email,contact_form,role}"
    },
    "DataservicePermissions": {
      "properties": {
        "delete": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "Dataservice__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_at": {
          "format": "date-time",
          "type": "string"
        },
        "authorization_request_url": {
          "type": "string"
        },
        "availability": {
          "maximum": 100,
          "minimum": 0,
          "type": "number"
        },
        "availability_url": {
          "type": "string"
        },
        "badges": {
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/Badge__read"
              }
            ],
            "readOnly": true
          },
          "readOnly": true,
          "type": "array"
        },
        "base_api_url": {
          "type": "string"
        },
        "business_documentation_url": {
          "type": "string"
        },
        "contact_points": {
          "items": {
            "$ref": "#/$defs/ContactPoint__read"
          },
          "type": "array"
        },
        "created_at": {
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "datasets": {
          "description": "Visit this API link to see the list.",
          "type": "object"
        },
        "deleted_at": {
          "format": "date-time",
          "type": "string"
        },
        "description": {
          "format": "markdown",
          "type": "string"
        },
        "extras": {
          "type": "object"
        },
        "featured": {
          "readOnly": true,
          "type": "boolean"
        },
        "format": {
          "enum": [
            "REST",
            "WMS",
            "WSL"
          ],
          "type": "string"
        },
        "harvest": {
          "allOf": [
            {
              "$ref": "#/$defs/HarvestMetadata__read"
            }
          ],
          "readOnly": true
        },
        "id": {
          "readOnly": true,
          "type": "string"
        },
        "license": {
          "description": "The ID of the license",
          "type": "string"
        },
        "machine_documentation_url": {
          "description": "Swagger link, OpenAPI format, WMS XML…",
          "type": "string"
        },
        "metadata_modified_at": {
          "format": "date-time",
          "readOnly": true,
          "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."
        },
        "permissions": {
          "allOf": [
            {
              "$ref": "#/$defs/DataservicePermissions"
            }
          ],
          "readOnly": true
        },
        "private": {
          "description": "Is the dataservice private to the owner or the organization",
          "type": "boolean"
        },
        "rate_limiting": {
          "type": "string"
        },
        "rate_limiting_url": {
          "type": "string"
        },
        "self_api_url": {
          "description": "Link to the API endpoint for this dataservice",
          "readOnly": true,
          "type": "string"
        },
        "self_web_url": {
          "description": "Link to the udata web page for this dataservice",
          "readOnly": true,
          "type": "string"
        },
        "slug": {
          "maxLength": 255,
          "readOnly": true,
          "type": "string"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "technical_documentation_url": {
          "description": "HTML version of a Swagger…",
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "created_at",
        "id",
        "metadata_modified_at",
        "slug",
        "title"
      ],
      "type": "object"
    },
    "HarvestMetadata__read": {
      "properties": {
        "archived_at": {
          "format": "date-time",
          "type": "string"
        },
        "archived_reason": {
          "type": "string"
        },
        "backend": {
          "type": "string"
        },
        "created_at": {
          "description": "Date of the creation as provided by the harvested catalog",
          "format": "date-time",
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "issued_at": {
          "description": "Release date as provided by the harvested catalog",
          "format": "date-time",
          "type": "string"
        },
        "last_update": {
          "description": "Date of the last harvesting",
          "format": "date-time",
          "type": "string"
        },
        "remote_id": {
          "type": "string"
        },
        "remote_url": {
          "type": "string"
        },
        "source_id": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "uri": {
          "description": "RDF node ID if it's an `URIRef`. `None` if it's not present or if it's a random auto-generated ID inside the graph.",
          "type": "string"
        }
      },
      "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"
        }
      ]
    },
    "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"
        }
      ]
    }
  }
}