Skip to content

Commit 13589b5

Browse files
committed
alphabetize common definitions
1 parent e43e044 commit 13589b5

1 file changed

Lines changed: 178 additions & 178 deletions

File tree

schema/templates/common.json

Lines changed: 178 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,75 @@
44
"title": "Common schema definitions for MDS",
55
"type": "object",
66
"definitions": {
7-
"version": {
8-
"$id": "#/definitions/version",
7+
"area_type": {
8+
"$id": "#/definitions/area_type",
99
"type": "string",
10-
"title": "The MDS Provider version this data represents",
11-
"examples": [
12-
"0.4.0"
13-
],
14-
"pattern": "^0\\.4\\.[0-9]+$"
10+
"description": "The type of a service area",
11+
"enum": [
12+
"unrestricted",
13+
"restricted",
14+
"preferred_pick_up",
15+
"preferred_drop_off"
16+
]
1517
},
16-
"uuid": {
17-
"$id": "#/definitions/uuid",
18-
"type": "string",
19-
"title": "A UUID used to uniquely identifty an object",
20-
"default": "",
21-
"examples": [
22-
"3c9604d6-b5ee-11e8-96f8-529269fb1459"
18+
"links": {
19+
"$id": "#/definitions/links",
20+
"type": "object",
21+
"required":[
22+
"next"
2323
],
24-
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
24+
"properties": {
25+
"first": {
26+
"$id": "#/definitions/links/first",
27+
"type": [
28+
"null",
29+
"string"
30+
],
31+
"title": "The URL to the first page of data",
32+
"examples": [
33+
"https://data.provider.co/trips/first"
34+
],
35+
"format": "uri"
36+
},
37+
"last": {
38+
"$id": "#/definitions/links/last",
39+
"type": [
40+
"null",
41+
"string"
42+
],
43+
"title": "The URL to the last page of data",
44+
"examples": [
45+
"https://data.provider.co/trips/last"
46+
],
47+
"format": "uri"
48+
},
49+
"prev": {
50+
"$id": "#/definitions/links/prev",
51+
"type": [
52+
"null",
53+
"string"
54+
],
55+
"title": "The URL to the previous page of data",
56+
"examples": [
57+
"https://data.provider.co/trips/prev"
58+
],
59+
"format": "uri"
60+
},
61+
"next": {
62+
"$id": "#/definitions/links/next",
63+
"type": [
64+
"null",
65+
"string"
66+
],
67+
"title": "The URL to the next page of data",
68+
"examples": [
69+
"https://data.provider.co/trips/next"
70+
],
71+
"format": "uri",
72+
"pattern": "^(.*)$"
73+
}
74+
},
75+
"additionalProperties": false
2576
},
2677
"propulsion_type": {
2778
"$id": "#/definitions/propulsion_type",
@@ -38,30 +89,93 @@
3889
},
3990
"minItems": 1
4091
},
41-
"vehicle_status": {
42-
"$id": "#/definitions/vehicle_status",
43-
"type": "string",
44-
"description": "The status of a vehicle",
45-
"enum": [
46-
"available",
47-
"elsewhere",
48-
"inactive",
49-
"removed",
50-
"reserved",
51-
"trip",
52-
"unavailable"
53-
]
92+
"telemetry": {
93+
"$id": "#/definitions/telemetry",
94+
"type": "object",
95+
"description": "A vehicle telemetry datum",
96+
"required": [
97+
"device_id",
98+
"timestamp",
99+
"gps"
100+
],
101+
"additionalProperties": false,
102+
"properties": {
103+
"device_id": {
104+
"$ref": "#/definitions/uuid"
105+
},
106+
"timestamp": {
107+
"$ref": "#/definitions/timestamp"
108+
},
109+
"gps": {
110+
"type": "object",
111+
"required": [
112+
"lat",
113+
"lng"
114+
],
115+
"additionalProperties": false,
116+
"properties": {
117+
"lat": {
118+
"type": "number",
119+
"description": "Latitude of the location",
120+
"minimum": -90,
121+
"maximum": 90
122+
},
123+
"lng": {
124+
"type": "number",
125+
"description": "Longitude of the location",
126+
"minimum": -180,
127+
"maximum": 180
128+
},
129+
"altitude": {
130+
"type": "number",
131+
"description": "Altitude above mean sea level in meters"
132+
},
133+
"heading": {
134+
"type": "number",
135+
"description": "Degrees clockwise from true north"
136+
},
137+
"speed": {
138+
"type": "number",
139+
"description": "Speed in meters/sec"
140+
},
141+
"accuracy": {
142+
"type": "number",
143+
"description": "Accuracy in meters"
144+
},
145+
"hdop": {
146+
"type": "number",
147+
"description": "Horizontal GPS or GNSS accuracy value"
148+
},
149+
"satellites": {
150+
"type": "integer",
151+
"description": "Number of GPS or GNSS satellites"
152+
}
153+
}
154+
},
155+
"charge": {
156+
"type": "number",
157+
"description": "Fraction of charge of the vehicle (required if applicable",
158+
"minimum": 0,
159+
"maximum": 1
160+
}
161+
}
54162
},
55-
"vehicle_type": {
56-
"$id": "#/definitions/vehicle_type",
163+
"timestamp": {
164+
"$id": "#/definitions/timestamp",
165+
"title": "Integer milliseconds since Unix epoch",
166+
"type": "number",
167+
"multipleOf": 1.0,
168+
"minimum": 0
169+
},
170+
"uuid": {
171+
"$id": "#/definitions/uuid",
57172
"type": "string",
58-
"description": "The type of vehicle",
59-
"enum": [
60-
"bicycle",
61-
"car",
62-
"scooter",
63-
"moped"
64-
]
173+
"title": "A UUID used to uniquely identifty an object",
174+
"default": "",
175+
"examples": [
176+
"3c9604d6-b5ee-11e8-96f8-529269fb1459"
177+
],
178+
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
65179
},
66180
"vehicle_event": {
67181
"$id": "#/definitions/vehicle_event",
@@ -180,153 +294,39 @@
180294
}
181295
]
182296
},
183-
"area_type": {
184-
"$id": "#/definitions/area_type",
297+
"vehicle_status": {
298+
"$id": "#/definitions/vehicle_status",
185299
"type": "string",
186-
"description": "The type of a service area",
300+
"description": "The status of a vehicle",
187301
"enum": [
188-
"unrestricted",
189-
"restricted",
190-
"preferred_pick_up",
191-
"preferred_drop_off"
302+
"available",
303+
"elsewhere",
304+
"inactive",
305+
"removed",
306+
"reserved",
307+
"trip",
308+
"unavailable"
192309
]
193310
},
194-
"telemetry": {
195-
"$id": "#/definitions/telemetry",
196-
"type": "object",
197-
"description": "A vehicle telemetry datum",
198-
"required": [
199-
"device_id",
200-
"timestamp",
201-
"gps"
202-
],
203-
"additionalProperties": false,
204-
"properties": {
205-
"device_id": {
206-
"$ref": "#/definitions/uuid"
207-
},
208-
"timestamp": {
209-
"$ref": "#/definitions/timestamp"
210-
},
211-
"gps": {
212-
"type": "object",
213-
"required": [
214-
"lat",
215-
"lng"
216-
],
217-
"additionalProperties": false,
218-
"properties": {
219-
"lat": {
220-
"type": "number",
221-
"description": "Latitude of the location",
222-
"minimum": -90,
223-
"maximum": 90
224-
},
225-
"lng": {
226-
"type": "number",
227-
"description": "Longitude of the location",
228-
"minimum": -180,
229-
"maximum": 180
230-
},
231-
"altitude": {
232-
"type": "number",
233-
"description": "Altitude above mean sea level in meters"
234-
},
235-
"heading": {
236-
"type": "number",
237-
"description": "Degrees clockwise from true north"
238-
},
239-
"speed": {
240-
"type": "number",
241-
"description": "Speed in meters/sec"
242-
},
243-
"accuracy": {
244-
"type": "number",
245-
"description": "Accuracy in meters"
246-
},
247-
"hdop": {
248-
"type": "number",
249-
"description": "Horizontal GPS or GNSS accuracy value"
250-
},
251-
"satellites": {
252-
"type": "integer",
253-
"description": "Number of GPS or GNSS satellites"
254-
}
255-
}
256-
},
257-
"charge": {
258-
"type": "number",
259-
"description": "Fraction of charge of the vehicle (required if applicable",
260-
"minimum": 0,
261-
"maximum": 1
262-
}
263-
}
311+
"vehicle_type": {
312+
"$id": "#/definitions/vehicle_type",
313+
"type": "string",
314+
"description": "The type of vehicle",
315+
"enum": [
316+
"bicycle",
317+
"car",
318+
"scooter",
319+
"moped"
320+
]
264321
},
265-
"links": {
266-
"$id": "#/definitions/links",
267-
"type": "object",
268-
"required":[
269-
"next"
322+
"version": {
323+
"$id": "#/definitions/version",
324+
"type": "string",
325+
"title": "The MDS Provider version this data represents",
326+
"examples": [
327+
"0.4.0"
270328
],
271-
"properties": {
272-
"first": {
273-
"$id": "#/definitions/links/first",
274-
"type": [
275-
"null",
276-
"string"
277-
],
278-
"title": "The URL to the first page of data",
279-
"examples": [
280-
"https://data.provider.co/trips/first"
281-
],
282-
"format": "uri"
283-
},
284-
"last": {
285-
"$id": "#/definitions/links/last",
286-
"type": [
287-
"null",
288-
"string"
289-
],
290-
"title": "The URL to the last page of data",
291-
"examples": [
292-
"https://data.provider.co/trips/last"
293-
],
294-
"format": "uri"
295-
},
296-
"prev": {
297-
"$id": "#/definitions/links/prev",
298-
"type": [
299-
"null",
300-
"string"
301-
],
302-
"title": "The URL to the previous page of data",
303-
"examples": [
304-
"https://data.provider.co/trips/prev"
305-
],
306-
"format": "uri"
307-
},
308-
"next": {
309-
"$id": "#/definitions/links/next",
310-
"type": [
311-
"null",
312-
"string"
313-
],
314-
"title": "The URL to the next page of data",
315-
"examples": [
316-
"https://data.provider.co/trips/next"
317-
],
318-
"format": "uri",
319-
"pattern": "^(.*)$"
320-
}
321-
},
322-
"additionalProperties": false
323-
},
324-
"timestamp": {
325-
"$id": "#/definitions/timestamp",
326-
"title": "Integer milliseconds since Unix epoch",
327-
"type": "number",
328-
"multipleOf": 1.0,
329-
"minimum": 0
329+
"pattern": "^0\\.4\\.[0-9]+$"
330330
}
331331
}
332332
}

0 commit comments

Comments
 (0)