{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stat-gov-pl/json-schema/stat-gov-pl-single-variable-data-schema.json",
  "title": "SingleVariableData",
  "description": "Zbiór danych dla zmiennej / Data set for single variable",
  "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/SingleVariableData",
  "type": "object",
  "properties": {
    "totalRecords": {
      "type": [
        "integer",
        "null"
      ],
      "description": "",
      "format": "int32"
    },
    "page": {
      "type": [
        "integer",
        "null"
      ],
      "description": "",
      "format": "int32"
    },
    "pageSize": {
      "type": [
        "integer",
        "null"
      ],
      "description": "",
      "format": "int32"
    },
    "links": {
      "$ref": "#/$defs/PageLinks"
    },
    "results": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/UnitData"
      },
      "description": ""
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "version": {
      "$ref": "#/$defs/Version"
    },
    "variableId": {
      "type": "integer",
      "description": "Identyfikator zmiennej / Variable's identifier",
      "format": "int32"
    },
    "measureUnitId": {
      "type": "integer",
      "description": "Identyfikator jednostki miary / Measure unit's identifier",
      "format": "int32"
    },
    "aggregateId": {
      "type": "integer",
      "description": "Identyfikator agregatu / Aggregate's identifier",
      "format": "int32"
    },
    "lastUpdate": {
      "type": [
        "string",
        "null"
      ],
      "description": "Data ostatniej modyfikacji / Last update",
      "format": "date-time"
    },
    "resultsOrdered": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/UnitData"
      },
      "description": "Wartości dla jednostek / Values for units"
    }
  },
  "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"
    },
    "PageLinks": {
      "type": "object",
      "properties": {
        "firstPage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Pierwsza strona / First page"
        },
        "prevPage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Poprzednia strona / Previous page"
        },
        "self": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bieżąca strona / Current page"
        },
        "nextPage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Następna strona / Next page"
        },
        "lastPage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Ostatnia strona / Last page"
        }
      },
      "additionalProperties": false,
      "description": "Linki do stron wyników / Result page links"
    },
    "UnitData": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identyfikator jednostki / Unit's identifier"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Nazwa jednostki / Unit's name"
        },
        "values": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/YearValue"
          },
          "description": "Lista wartości w latach / Value in years list"
        }
      },
      "additionalProperties": false,
      "description": "Definicja listy wartości dla jednostki / Value list for unit 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"
    },
    "YearValue": {
      "type": "object",
      "properties": {
        "year": {
          "type": [
            "string",
            "null"
          ],
          "description": "Rok / Year"
        },
        "value": {
          "type": "number",
          "description": "Wartośc liczbowa / Numeric value",
          "format": "double"
        },
        "valueFormatted": {
          "type": [
            "string",
            "null"
          ],
          "description": "Wyprowadzanie sformatowanej wartosci do XML i JSON"
        },
        "attrId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Identyfikator atrybutu / Attribute's identifier",
          "format": "int32"
        },
        "precision": {
          "type": "integer",
          "description": "Precyzja wartości liczbowej / Value's decimal precision",
          "format": "int32"
        }
      },
      "additionalProperties": false,
      "description": "Definicja wartości w roku / Value in year definition"
    }
  }
}