Skip to content

Commit 9a6eeec

Browse files
committed
geographies array template and generator
reuses the single geography schema/definition
1 parent e0f0ca2 commit 9a6eeec

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

schema/geography.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ def geography_schema():
3030
return common.check_schema(schema)
3131

3232

33+
def geographies_schema():
34+
"""
35+
Create the schema for the Geographies endpoint.
36+
"""
37+
# load schema template and insert definitions from geography
38+
geography = geography_schema()
39+
schema = common.load_json("./templates/geography/geographies.json")
40+
schema["definitions"].update(geography["definitions"])
41+
42+
return common.check_schema(schema)
43+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/openmobilityfoundation/mobility-data-specification/main/geography/geographies.json",
3+
"$schema": "http://json-schema.org/draft-06/schema#",
4+
"title": "The MDS Geographies Schema",
5+
"type": "object",
6+
"definitions": {
7+
},
8+
"required": [
9+
"geographies",
10+
"updated",
11+
"version"
12+
],
13+
"properties": {
14+
"geographies": {
15+
"$id": "#/properties/geographies",
16+
"type": "array",
17+
"title": "The array of policy objects in this payload",
18+
"items": {
19+
"$id": "#/properties/geographies/items",
20+
"$ref": "#/definitions/geography"
21+
}
22+
},
23+
"updated": {
24+
"$id": "#/properties/updated",
25+
"$ref": "#/definitions/timestamp",
26+
"description": "The timestamp when geographies was last updated"
27+
},
28+
"version": {
29+
"$id": "#/properties/version",
30+
"$ref": "#/definitions/version",
31+
"description": "The version of MDS that the geographies represents"
32+
}
33+
},
34+
"additionalProperties": false
35+
}

0 commit comments

Comments
 (0)