1
0
Files

113 lines
2.3 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://processgit.org/Valsts-Pirmkods/MK-Lemumi-as-Code/raw/branch/main/schemas/tap-politikas-jomas-0.1.schema.json",
"title": "TAP politikas jomas",
"description": "Tiesību aktu portāla (TAP) politikas jomu klasifikācija (divi līmeņi: virsjoma un joma), kā publicēta data.gov.lv (JSON:API datne policy_areas.json).",
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/PolicyArea"
}
},
"meta": {
"type": "object"
}
},
"$defs": {
"PolicyArea": {
"type": "object",
"required": [
"id",
"type",
"attributes"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"type": {
"const": "policy_areas"
},
"attributes": {
"type": "object",
"required": [
"name",
"active_from",
"active_to"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"active_from": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
},
"active_to": {
"anyOf": [
{
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
},
{
"type": "null"
}
]
}
}
},
"relationships": {
"type": "object",
"additionalProperties": false,
"properties": {
"parent_value": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"type",
"id"
],
"additionalProperties": false,
"properties": {
"type": {
"const": "policy_areas"
},
"id": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}
}
},
{
"type": "null"
}
]
}
}
}
}
},
"links": {
"type": "object"
}
}
}
},
"additionalProperties": false
}