Repository navigation
Expand file tree
/
Copy pathparams-schema.json
More file actions
208 lines (208 loc) · 7.18 KB
/
Copy pathparams-schema.json
File metadata and controls
208 lines (208 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"$comment": "Keep in sync with ttsim/src/ttsim/params-schema.json, except unitToken: this GETTSIM copy pins the grouping levels to Germany's, ttsim leaves them open.",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"unitToken": {
"$comment": "Bases stay open (currencies register per package); the grouping level, if present, must be one of Germany's.",
"type": "string",
"pattern": "^[A-Z][A-Z0-9]*(?:_(?!PER_)[A-Z0-9]+)*(?:_PER_(?:SQUARE_METER|HOURS))?(?:_PER_(?:YEAR|QUARTER|MONTH|WEEK|DAY))?(?:_PER_(?:HH|EHE|FG|BG|EG|WTHH|SN|PERSON))?$"
},
"unitDeclaration": {
"oneOf": [
{ "$ref": "#/definitions/unitToken" },
{
"type": "object",
"additionalProperties": { "$ref": "#/definitions/unitDeclaration" }
}
]
},
"axisUnitDeclaration": {
"$ref": "#/definitions/unitToken"
}
},
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9äöüßÄÖÜ_]+$": {
"type": "object",
"properties": {
"name": {
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": ["string", "null"] }
},
"required": ["de"],
"additionalProperties": false
},
"description": {
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": ["string", "null"] }
},
"required": ["de"],
"additionalProperties": false
},
"unit": {
"$ref": "#/definitions/unitDeclaration"
},
"input_unit": {
"$ref": "#/definitions/axisUnitDeclaration"
},
"output_unit": {
"$ref": "#/definitions/axisUnitDeclaration"
},
"type": {
"type": "string",
"enum": [
"scalar",
"dict",
"piecewise_constant",
"piecewise_linear",
"piecewise_quadratic",
"piecewise_cubic",
"consecutive_int_lookup_table",
"sparse_to_consecutive_int_lookup_table",
"month_based_phase_inout_of_age_thresholds",
"year_based_phase_inout_of_age_thresholds",
"require_converter"
]
},
"add_jahresanfang": {"type": "boolean"}
},
"patternProperties": {
"^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-[0-3][0-9]$": {
"type": "object",
"properties": {
"value": {
"oneOf": [
{ "type": ["number"] },
{ "type": "string", "enum": ["inf", "-inf"] }
]
},
"intervals": {
"type": "array",
"items": {
"type": "object",
"properties": {
"interval": { "type": "string" }
},
"required": ["interval"],
"additionalProperties": true
}
},
"unit": {
"$ref": "#/definitions/unitDeclaration"
},
"input_unit": {
"$ref": "#/definitions/axisUnitDeclaration"
},
"output_unit": {
"$ref": "#/definitions/axisUnitDeclaration"
},
"reference": { "type": "string" },
"note": { "type": "string" },
"deviation_from": { "type": "string" },
"updates_previous": { "type": "boolean" }
},
"additionalProperties": true
}
},
"additionalProperties": false,
"allOf": [
{ "required": [
"name",
"description",
"type"
]
},
{
"if": {
"properties": {
"type": {
"enum": [
"piecewise_constant",
"piecewise_linear",
"piecewise_quadratic",
"piecewise_cubic",
"consecutive_int_lookup_table",
"sparse_to_consecutive_int_lookup_table",
"month_based_phase_inout_of_age_thresholds",
"year_based_phase_inout_of_age_thresholds"
]
}
}
},
"then": {
"$comment": "A piecewise / lookup / phase-inout parameter declares its input and output units either as a top-level `input_unit:`/`output_unit:` pair, or — for a parameter re-denominated over time (e.g. DM before the 2002 euro reform, EUR after) — as one `input_unit:`/`output_unit:` pair inside each date-specific key (GEP 10). The latter carries no top-level unit declaration; the build-time mandatory-units check (`fail_if_environment_units_are_missing`) guarantees every active leaf still resolves to a unit.",
"oneOf": [
{
"required": ["input_unit", "output_unit"],
"not": { "required": ["unit"] }
},
{
"allOf": [
{ "not": { "required": ["unit"] } },
{ "not": { "required": ["input_unit"] } },
{ "not": { "required": ["output_unit"] } }
]
}
]
},
"else": {
"if": {
"properties": { "type": { "const": "require_converter" } }
},
"then": {
"$comment": "A require_converter parameter declares its unit(s) in one of three ways: a single top-level `unit:`; a top-level `input_unit:`/`output_unit:` pair; or, for a parameter re-denominated over time, one `unit:` inside each date-specific key (GEP 10). The third case carries no top-level unit declaration; the build-time mandatory-units check (`fail_if_environment_units_are_missing`) guarantees every active leaf still resolves to a unit.",
"oneOf": [
{
"required": ["unit"],
"allOf": [
{ "not": { "required": ["input_unit"] } },
{ "not": { "required": ["output_unit"] } }
]
},
{
"required": ["input_unit", "output_unit"],
"not": { "required": ["unit"] }
},
{
"allOf": [
{ "not": { "required": ["unit"] } },
{ "not": { "required": ["input_unit"] } },
{ "not": { "required": ["output_unit"] } }
]
}
]
},
"else": {
"allOf": [
{ "not": { "required": ["input_unit"] } },
{ "not": { "required": ["output_unit"] } }
]
}
}
},
{
"if": {
"properties": { "type": { "const": "scalar" } },
"required": ["type"]
},
"then": {
"properties": {
"unit": { "$ref": "#/definitions/unitToken" }
}
}
},
{
"minProperties": 1,
"patternProperties": {
"^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-[0-3][0-9]$": {}
}
}
]
}
},
"additionalProperties": false
}