Skip to content

Commit 83fff3c

Browse files
committed
generate schemas from new definitions
1 parent 2863b4f commit 83fff3c

9 files changed

Lines changed: 943 additions & 204 deletions

agency/post_stops.json

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/openmobilityfoundation/mobility-data-specification/main/agency/post_stops.json",
3+
"$schema": "http://json-schema.org/draft-06/schema#",
4+
"title": "The MDS Agency Schema, register Stops",
5+
"type": "object",
6+
"definitions": {
7+
"stop": {
8+
"$id": "#/definitions/stop",
9+
"type": "object",
10+
"description": "The common schema elements for a Stop in MDS",
11+
"required": [
12+
"stop_id",
13+
"name",
14+
"last_reported",
15+
"location",
16+
"status",
17+
"capacity",
18+
"num_vehicles_available",
19+
"num_vehicles_disabled"
20+
],
21+
"properties": {
22+
"stop_id": {
23+
"$id": "#/definitions/stop/properties/stop_id",
24+
"$ref": "#/definitions/uuid",
25+
"description": "UUID for the Stop"
26+
},
27+
"name": {
28+
"$id": "#/definitions/stop/properties/name",
29+
"$ref": "#/definitions/string",
30+
"description": "Name of the Stop"
31+
},
32+
"last_reported": {
33+
"$id": "#/definitions/stop/properties/last_reported",
34+
"$ref": "#/definitions/timestamp",
35+
"description": "Date/Time of the last status update for this Stop"
36+
},
37+
"location": {
38+
"$id": "#/definitions/stop/properties/location",
39+
"$ref": "#/definitions/MDS_Feature_Point",
40+
"description": "Location of the stop"
41+
},
42+
"status": {
43+
"$id": "#/definitions/stop/properties/status",
44+
"$ref": "#/definitions/stop_status",
45+
"description": "The status of the Stop"
46+
},
47+
"capacity": {
48+
"$id": "#/definitions/stop/properties/capacity",
49+
"$ref": "#/definitions/vehicle_type_counts",
50+
"description": "Number of total spaces per vehicle_type"
51+
},
52+
"num_vehicles_available": {
53+
"$id": "#/definitions/stop/properties/num_vehicles_available",
54+
"$ref": "#/definitions/vehicle_type_counts",
55+
"description": "Number of available vehicles per vehicle_type"
56+
},
57+
"num_vehicles_disabled": {
58+
"$id": "#/definitions/stop/properties/num_vehicles_disabled",
59+
"$ref": "#/definitions/vehicle_type_counts",
60+
"description": "Number of non_operational/reserved vehicles per vehicle_type"
61+
},
62+
"provider_id": {
63+
"$id": "#/definitions/stop/properties/provider_id",
64+
"$ref": "#/definitions/uuid",
65+
"description": "UUID for the Provider managing this Stop. Null/undefined if managed by an Agency."
66+
},
67+
"geography_id": {
68+
"$id": "#/definitions/stop/properties/geography_id",
69+
"$ref": "#/definitions/uuid",
70+
"description": "UUID for the Stop"
71+
},
72+
"region_id": {
73+
"$id": "#/definitions/stop/properties/region_id",
74+
"$ref": "#/definitions/string",
75+
"description": "ID of the region where the Stop is located. See GBFS Station Information."
76+
},
77+
"short_name": {
78+
"$id": "#/definitions/stop/properties/short_name",
79+
"$ref": "#/definitions/string",
80+
"description": "Abbreviated Stop name"
81+
},
82+
"address": {
83+
"$id": "#/definitions/stop/properties/address",
84+
"$ref": "#/definitions/string",
85+
"description": "Postal address (useful for directions)"
86+
},
87+
"post_code": {
88+
"$id": "#/definitions/stop/properties/post_code",
89+
"$ref": "#/definitions/string",
90+
"description": "Postal code (e.g. 10036)"
91+
},
92+
"cross_street": {
93+
"$id": "#/definitions/stop/properties/cross_street",
94+
"$ref": "#/definitions/string",
95+
"description": "Cross street of where Stop is located"
96+
},
97+
"num_spaces_available": {
98+
"$id": "#/definitions/stop/properties/num_spaces_available",
99+
"$ref": "#/definitions/vehicle_type_counts",
100+
"description": "Number of spaces free to be populated per vehicle_type"
101+
},
102+
"num_spaces_disabled": {
103+
"$id": "#/definitions/stop/properties/num_spaces_disabled",
104+
"$ref": "#/definitions/vehicle_type_counts",
105+
"description": "Number of spaces disabled an unable to accept vehicles per vehicle_type"
106+
},
107+
"parent_stop": {
108+
"$id": "#/definitions/stop/properties/parent_stop",
109+
"$ref": "#/definitions/uuid",
110+
"description": "Describe a basic hierarchy of Stops (e.g. a Stop inside a greater Stop)"
111+
},
112+
"devices": {
113+
"$id": "#/definitions/stop/properties/devices",
114+
"type": "array",
115+
"description": "List of device_id for vehicles currently at this Stop.",
116+
"items": {
117+
"$ref": "#/definitions/uuid"
118+
}
119+
}
120+
}
121+
},
122+
"stop_status": {
123+
"$id": "#/definitions/stop_status",
124+
"type": "object",
125+
"description": "Status object for a Stop in MDS",
126+
"required": [
127+
"is_installed",
128+
"is_renting",
129+
"is_returning"
130+
],
131+
"properties": {
132+
"is_installed": {
133+
"$id": "#/definitions/stop_status/properties/is_installed",
134+
"type": "boolean"
135+
},
136+
"is_renting": {
137+
"$id": "#/definitions/stop_status/properties/is_renting",
138+
"type": "boolean"
139+
},
140+
"is_returning": {
141+
"$id": "#/definitions/stop_status/properties/is_returning",
142+
"type": "boolean"
143+
}
144+
}
145+
},
146+
"string": {
147+
"$id": "#/definitions/string",
148+
"type": "string",
149+
"description": "A length-limited string type",
150+
"maxLength": 255,
151+
"default": "",
152+
"examples": [
153+
"ABC123"
154+
],
155+
"pattern": "^(.*)$"
156+
},
157+
"timestamp": {
158+
"$id": "#/definitions/timestamp",
159+
"type": "number",
160+
"description": "Integer milliseconds since Unix epoch",
161+
"multipleOf": 1.0,
162+
"minimum": 0
163+
},
164+
"uuid": {
165+
"$id": "#/definitions/uuid",
166+
"type": "string",
167+
"description": "A UUID used to uniquely identifty an object",
168+
"default": "",
169+
"examples": [
170+
"3c9604d6-b5ee-11e8-96f8-529269fb1459"
171+
],
172+
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
173+
},
174+
"vehicle_type_counts": {
175+
"$id": "#/definitions/vehicle_type_counts",
176+
"type": "object",
177+
"properties": {
178+
"bicycle": {
179+
"$id": "#/definitions/vehicle_type_counts/properties/bicycle",
180+
"type": "integer",
181+
"minimum": 0
182+
},
183+
"car": {
184+
"$id": "#/definitions/vehicle_type_counts/properties/car",
185+
"type": "integer",
186+
"minimum": 0
187+
},
188+
"scooter": {
189+
"$id": "#/definitions/vehicle_type_counts/properties/scooter",
190+
"type": "integer",
191+
"minimum": 0
192+
},
193+
"moped": {
194+
"$id": "#/definitions/vehicle_type_counts/properties/moped",
195+
"type": "integer",
196+
"minimum": 0
197+
},
198+
"other": {
199+
"$id": "#/definitions/vehicle_type_counts/properties/other",
200+
"type": "integer",
201+
"minimum": 0
202+
}
203+
},
204+
"additionalProperties": false
205+
},
206+
"MDS_Feature_Point": {
207+
"$id": "#/definitions/MDS_Feature_Point",
208+
"title": "MDS GeoJSON Feature Point",
209+
"type": "object",
210+
"required": [
211+
"type",
212+
"properties",
213+
"geometry"
214+
],
215+
"properties": {
216+
"type": {
217+
"type": "string",
218+
"enum": [
219+
"Feature"
220+
]
221+
},
222+
"properties": {
223+
"type": "object",
224+
"required": [
225+
"timestamp"
226+
],
227+
"properties": {
228+
"timestamp": {
229+
"$ref": "#/definitions/timestamp"
230+
},
231+
"stop_id": {
232+
"$ref": "#/definitions/uuid"
233+
}
234+
}
235+
},
236+
"geometry": {
237+
"$ref": "#/definitions/Point"
238+
},
239+
"bbox": {
240+
"type": "array",
241+
"minItems": 4,
242+
"items": {
243+
"type": "number"
244+
}
245+
}
246+
}
247+
}
248+
},
249+
"required": [
250+
"stops"
251+
],
252+
"properties": {
253+
"stops": {
254+
"$id": "#/properties/stops",
255+
"type": "array",
256+
"description": "The array of stops",
257+
"items": {
258+
"$ref": "#/definitions/stop"
259+
}
260+
}
261+
},
262+
"additionalProperties": false
263+
}

agency/post_vehicle_event.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
"multipleOf": 1.0,
8383
"minimum": 0
8484
},
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+
},
8595
"vehicle_state": {
8696
"$id": "#/definitions/vehicle_state",
8797
"type": "string",

agency/post_vehicle_telemetry.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@
7474
"maximum": 1
7575
}
7676
}
77+
},
78+
"timestamp": {
79+
"$id": "#/definitions/timestamp",
80+
"type": "number",
81+
"description": "Integer milliseconds since Unix epoch",
82+
"multipleOf": 1.0,
83+
"minimum": 0
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})$"
7794
}
7895
},
7996
"required": [

0 commit comments

Comments
 (0)