Skip to content

Commit c5b12e3

Browse files
committed
define an array of uuid type
used by policy and stops
1 parent fc74c1c commit c5b12e3

4 files changed

Lines changed: 20 additions & 10 deletions

File tree

schema/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def stop_definitions():
199199
"string",
200200
"timestamp",
201201
"uuid",
202+
"uuid_array",
202203
"vehicle_type_counts"
203204
)
204205
definitions.update(mds_feature_point_definition())

schema/policy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def policy_schema():
2323
"string",
2424
"timestamp",
2525
"uuid",
26+
"uuid_array",
2627
"vehicle_event",
2728
"vehicle_type",
2829
"vehicle_types",

schema/templates/common.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,8 @@
264264
},
265265
"devices": {
266266
"$id": "#/definitions/stop/properties/devices",
267-
"type": "array",
268-
"description": "List of device_id for vehicles currently at this Stop.",
269-
"items": {
270-
"$ref": "#/definitions/uuid"
271-
}
267+
"$ref": "#/definitions/uuid_array",
268+
"description": "List of device_id for vehicles currently at this Stop."
272269
}
273270
}
274271
},
@@ -429,6 +426,15 @@
429426
],
430427
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
431428
},
429+
"uuid_array": {
430+
"$id": "#/definitions/uuid_array",
431+
"type": "array",
432+
"description": "Array of UUID",
433+
"items": {
434+
"$id": "#/definitions/uuid_array/items",
435+
"$ref": "#/definitions/uuid"
436+
}
437+
},
432438
"vehicle": {
433439
"$id": "#/definitions/vehicle",
434440
"type": "object",

schema/templates/policy/policy.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
"$ref": "#/definitions/uuid",
2929
"description": "Unique ID of policy"
3030
},
31+
"provider_ids":{
32+
"$id": "#/definitions/policy/properties/provider_ids",
33+
"$ref": "#/definitions/uuid_array",
34+
"description": "Providers for whom this policy is applicable; empty arrays and null/absent implies all Providers.",
35+
"uniqueItems": true
36+
},
3137
"description": {
3238
"$id": "#/definitions/policy/properties/description",
3339
"$ref": "#/definitions/string",
@@ -97,12 +103,8 @@
97103
},
98104
"geographies": {
99105
"$id": "#/definitions/rule/properties/geographies",
100-
"type": "array",
106+
"$ref": "#/definitions/uuid_array",
101107
"description": "List of Geography UUIDs (non-overlapping) specifying the covered geography",
102-
"items": {
103-
"$id": "#/definitions/rule/properties/geographies/items",
104-
"$ref": "#/definitions/uuid"
105-
},
106108
"minItems": 1,
107109
"uniqueItems": true
108110
},

0 commit comments

Comments
 (0)