{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stat-gov-pl/json-schema/stat-gov-pl-unit-details-schema.json",
  "title": "UnitDetails",
  "description": "Szczegółowa reprezentacja jednostki terytorialnej / Detailed representation of the territorial unit",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stat-gov-pl-bdl-openapi.yml#/components/schemas/UnitDetails",
  "type": "object",
  "properties": {
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "version": {
      "$ref": "#/$defs/Version"
    },
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Identyfikator jednostki terytorialnej / Territorial unit identifier"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Nazwa jednostki terytorialnej / Territorial unit name"
    },
    "parentId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Identyfikator nadrzędny jednostki terytorialnej / Parent territorial unit identifier"
    },
    "level": {
      "type": "integer",
      "description": "Poziom jednostki terytorialnej / Territorial unit level",
      "format": "int32"
    },
    "kind": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rodzaj jednostki terytorialnej / Territorial unit kind"
    },
    "hasDescription": {
      "type": "boolean",
      "description": "Czy jednostka terytorialna posiada opis / Does territorial unit has description"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opis jednostki terytorialnej / Territorial unit description"
    },
    "years": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "format": "int32"
      },
      "description": "Lata obowiązywania jednostki terytorialnej / Years of territorial unit validity"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Metadata": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Id metadanych / Matadata's id"
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "Nazwa zasobu / Resource name"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Url zasobu / Resource Url"
        },
        "provider": {
          "type": [
            "string",
            "null"
          ],
          "description": "Dostawca zasobu / Resource provider"
        },
        "modificationDate": {
          "type": "string",
          "description": "Data ostatniej modyfikacji / Last modification date",
          "format": "date-time"
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opis zasobu / Resource description"
        },
        "keywords": {
          "type": [
            "string",
            "null"
          ],
          "description": "Słowa kluczowe / Describing keywords"
        },
        "temporalCoverage": {
          "type": [
            "string",
            "null"
          ],
          "description": ""
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "description": "Języki prezentowania zasobu / Resource's languages"
        },
        "updatePeriod": {
          "type": [
            "string",
            "null"
          ],
          "description": "Częstotliwość aktualizacji / Update frequency"
        },
        "contentType": {
          "type": [
            "string",
            "null"
          ],
          "description": "Typ treści / Content type"
        }
      },
      "additionalProperties": false,
      "description": "Definicja metadanych zasobu / Resource metadata definition"
    },
    "Version": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Pełny numer wersji / Full version number"
        },
        "major": {
          "type": "integer",
          "description": "Numer główny wersji / The main version number",
          "format": "int32"
        },
        "minor": {
          "type": "integer",
          "description": "Numer dodatkowy wersji / The additional version number",
          "format": "int32"
        },
        "modificationDate": {
          "type": "string",
          "description": "Data ostatniej modyfikacji / Date of the last modification",
          "format": "date-time"
        },
        "deprecated": {
          "type": [
            "string",
            "null"
          ],
          "description": "Data wycofania / Date of the deprecation",
          "format": "date-time"
        }
      },
      "additionalProperties": false,
      "description": "Reprezentacja wersji API BDL / Representation of the API BDL version"
    }
  }
}