Skip to content

Commit aed2e57

Browse files
committed
generate the single geography schema document
1 parent a8ac004 commit aed2e57

1 file changed

Lines changed: 154 additions & 0 deletions

File tree

geography/geography.json

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/openmobilityfoundation/mobility-data-specification/main/geography/geography.json",
3+
"$schema": "http://json-schema.org/draft-06/schema#",
4+
"title": "The MDS Geography Schema",
5+
"type": "object",
6+
"definitions": {
7+
"geography": {
8+
"$id": "#/definitions/geography",
9+
"type": "object",
10+
"title": "The geography object schema",
11+
"additionalProperties": false,
12+
"required": [
13+
"name",
14+
"geography_id",
15+
"geography_json",
16+
"published_date"
17+
],
18+
"properties": {
19+
"name": {
20+
"$id": "#/definitions/geography/properties/name",
21+
"$ref": "#/definitions/string",
22+
"description": "Name of geography"
23+
},
24+
"description": {
25+
"$id": "#/definitions/geography/properties/description",
26+
"$ref": "#/definitions/string",
27+
"description": "Description of geography"
28+
},
29+
"geography_type": {
30+
"$id": "#/definitions/geography/properties/geography_type",
31+
"type": "string",
32+
"description": "The type of geography"
33+
},
34+
"geography_id": {
35+
"$id": "#/definitions/geography/properties/geography_id",
36+
"$ref": "#/definitions/uuid",
37+
"description": "Unique ID of geography"
38+
},
39+
"geography_json": {
40+
"$id": "#/definitions/geography/properties/geography_json",
41+
"$ref": "https://geojson.org/schema/FeatureCollection.json",
42+
"description": "The GeoJSON FeatureCollection that defines the geographical coordinates"
43+
},
44+
"effective_date": {
45+
"$id": "#/definitions/geography/properties/effective_date",
46+
"$ref": "#/definitions/null_timestamp",
47+
"description": "The date at which a Geography is considered 'live'. Must be at or after published_date."
48+
},
49+
"published_date": {
50+
"$id": "#/definitions/geography/properties/published_date",
51+
"$ref": "#/definitions/timestamp",
52+
"description": "Timestamp at which the geography was published i.e. made immutable"
53+
},
54+
"retire_date": {
55+
"$id": "#/definitions/geography/properties/end_date",
56+
"$ref": "#/definitions/null_timestamp",
57+
"description": "Time that the geography is slated to retire. Once the retire date is passed, new policies can no longer reference it and old policies referencing it should be updated. Retired geographies should continue to be returned in the geographies list. Must be after effective_date."
58+
},
59+
"prev_geographies": {
60+
"$id": "#/definitions/geography/properties/prev_geographies",
61+
"$ref": "#/definitions/null_uuid_array",
62+
"description": "Unique IDs of prior geographies replaced by this one",
63+
"uniqueItems": true
64+
}
65+
}
66+
},
67+
"string": {
68+
"$id": "#/definitions/string",
69+
"type": "string",
70+
"description": "A length-limited string type",
71+
"maxLength": 255,
72+
"default": "",
73+
"examples": [
74+
"ABC123"
75+
],
76+
"pattern": "^(.*)$"
77+
},
78+
"timestamp": {
79+
"$id": "#/definitions/timestamp",
80+
"type": "number",
81+
"description": "Integer milliseconds since Unix epoch",
82+
"multipleOf": 1.0,
83+
"minimum": 1514764800000
84+
},
85+
"uuid": {
86+
"$id": "#/definitions/uuid",
87+
"type": "string",
88+
"description": "A UUID used to uniquely identifty an object",
89+
"default": "",
90+
"examples": [
91+
"3c9604d6-b5ee-11e8-96f8-529269fb1459"
92+
],
93+
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
94+
},
95+
"version": {
96+
"$id": "#/definitions/version",
97+
"type": "string",
98+
"description": "The version of MDS this data represents",
99+
"examples": [
100+
"1.2.0"
101+
],
102+
"pattern": "^1\\.2\\.[0-9]+$"
103+
},
104+
"uuid_array": {
105+
"$id": "#/definitions/uuid_array",
106+
"type": "array",
107+
"description": "Array of UUID",
108+
"items": {
109+
"$id": "#/definitions/uuid_array/items",
110+
"$ref": "#/definitions/uuid"
111+
}
112+
},
113+
"null_timestamp": {
114+
"$id": "#/definitions/null_timestamp",
115+
"type": [
116+
"number",
117+
"null"
118+
],
119+
"description": "Integer milliseconds since Unix epoch",
120+
"multipleOf": 1.0,
121+
"minimum": 1514764800000
122+
},
123+
"null_uuid_array": {
124+
"$id": "#/definitions/null_uuid_array",
125+
"type": [
126+
"array",
127+
"null"
128+
],
129+
"description": "Array of UUID",
130+
"items": {
131+
"$id": "#/definitions/uuid_array/items",
132+
"$ref": "#/definitions/uuid"
133+
}
134+
}
135+
},
136+
"required": [
137+
"geography",
138+
"version"
139+
],
140+
"properties": {
141+
"geography": {
142+
"$id": "#/properties/geography",
143+
"$ref": "#/definitions/geography",
144+
"description": "The geography in this payload",
145+
"additionalProperties": false
146+
},
147+
"version": {
148+
"$id": "#/properties/version",
149+
"$ref": "#/definitions/version",
150+
"description": "The version of MDS that the geography represents"
151+
}
152+
},
153+
"additionalProperties": false
154+
}

0 commit comments

Comments
 (0)