Skip to content

Commit cbc7c85

Browse files
Modify schemas for v1.1 (#32)
Adds versions + changes to system_information
1 parent 754e502 commit cbc7c85

11 files changed

+319
-26
lines changed

free_bike_status.json

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1"
23+
]
24+
},
1725
"data": {
1826
"description": "Array that contains one object per bike as defined below.",
1927
"type": "object",
@@ -49,24 +57,46 @@
4957
"minimum": 0,
5058
"maximum": 1
5159
},
52-
"required": [
53-
"bike_id",
54-
"lat",
55-
"lon",
56-
"is_reserved",
57-
"is_disabled"
58-
]
60+
"rental_uris": {
61+
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
62+
"type": "object",
63+
"properties": {
64+
"android": {
65+
"description": "URI that can be passed to an Android app with an intent (added in v1.1).",
66+
"type": "string",
67+
"format": "uri"
68+
},
69+
"ios": {
70+
"description": "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).",
71+
"type": "string",
72+
"format": "uri"
73+
},
74+
"web": {
75+
"description": "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).",
76+
"type": "string",
77+
"format": "uri"
78+
}
79+
}
80+
}
5981
},
6082
"required": [
61-
"bikes"
83+
"bike_id",
84+
"lat",
85+
"lon",
86+
"is_reserved",
87+
"is_disabled"
6288
]
6389
}
6490
},
6591
"required": [
66-
"last_updated",
67-
"ttl",
68-
"data"
92+
"bikes"
6993
]
7094
}
71-
}
95+
},
96+
"required": [
97+
"last_updated",
98+
"ttl",
99+
"version",
100+
"data"
101+
]
72102
}

gbfs.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0"
25+
]
26+
},
1727
"data": {
1828
"description": "Response data in the form of name:value pairs.",
1929
"type": "object",
@@ -32,6 +42,7 @@
3242
"type": "string",
3343
"enum": [
3444
"gbfs",
45+
"gbfs_versions",
3546
"system_information",
3647
"station_information",
3748
"station_status",
@@ -66,6 +77,7 @@
6677
"required": [
6778
"last_updated",
6879
"ttl",
80+
"version",
6981
"data"
7082
]
7183
}

gbfs_versions.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#gbfs_versionsjson-added-in-v11",
4+
"description": "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)",
5+
"type": "object",
6+
"properties": {
7+
"last_updated": {
8+
"description": "Last time the data in the feed was updated in POSIX time.",
9+
"type": "integer",
10+
"minimum": 1450155600
11+
},
12+
"ttl": {
13+
"description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).",
14+
"type": "integer",
15+
"minimum": 0
16+
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework.",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0",
25+
"2.1-RC",
26+
"2.1",
27+
"3.0-RC",
28+
"3.0"
29+
]
30+
},
31+
"data": {
32+
"description": "Response data in the form of name:value pairs.",
33+
"type": "object",
34+
"properties": {
35+
"versions": {
36+
"description": "Contains one object, as defined below, for each of the available versions of a feed. The array must be sorted by increasing MAJOR and MINOR version number.",
37+
"type": "array",
38+
"items": {
39+
"type": "object",
40+
"properties": {
41+
"version": {
42+
"description": "The semantic version of the feed in the form X.Y",
43+
"type": "string",
44+
"enum": [
45+
"1.1-RC",
46+
"1.1",
47+
"2.0-RC",
48+
"2.0",
49+
"2.1-RC",
50+
"2.1-RC2",
51+
"3.0-RC",
52+
"3.0"
53+
]
54+
},
55+
"url": {
56+
"description": "URL of the corresponding gbfs.json endpoint",
57+
"type": "string",
58+
"format": "uri"
59+
}
60+
},
61+
"required": [
62+
"version",
63+
"url"
64+
]
65+
}
66+
},
67+
"required": true
68+
},
69+
"additionalProperties": false
70+
}
71+
},
72+
"required": [
73+
"last_updated",
74+
"ttl",
75+
"version",
76+
"data"
77+
]
78+
}

station_information.json

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0"
25+
]
26+
},
1727
"data": {
1828
"description": "Array that contains one object per station as defined below.",
1929
"type": "object",
@@ -80,27 +90,49 @@
8090
"minItems": 1
8191
},
8292
"capacity": {
83-
"description": "Number of total docking points installed at this tation, both available and unavailable.",
93+
"description": "Number of total docking points installed at this station, both available and unavailable.",
8494
"type": "number",
8595
"minimum": 0
8696
},
87-
"required": [
88-
"station_id",
89-
"name",
90-
"lat",
91-
"lon"
92-
]
97+
"rental_uris": {
98+
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
99+
"type": "object",
100+
"properties": {
101+
"android": {
102+
"description": "URI that can be passed to an Android app with an intent (added in v1.1).",
103+
"type": "string",
104+
"format": "uri"
105+
},
106+
"ios": {
107+
"description": "URI that can be used on iOS to launch the rental app for this station (added in v1.1).",
108+
"type": "string",
109+
"format": "uri"
110+
},
111+
"web": {
112+
"description": "URL that can be used by a web browser to show more information about renting a vehicle at this station (added in v1.1).",
113+
"type": "string",
114+
"format": "uri"
115+
}
116+
}
117+
}
93118
},
94119
"required": [
95-
"stations"
120+
"station_id",
121+
"name",
122+
"lat",
123+
"lon"
96124
]
97125
}
98126
},
99127
"required": [
100-
"last_updated",
101-
"ttl",
102-
"data"
128+
"stations"
103129
]
104130
}
105-
}
131+
},
132+
"required": [
133+
"last_updated",
134+
"ttl",
135+
"version",
136+
"data"
137+
]
106138
}

station_status.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1"
23+
]
24+
},
1725
"data": {
1826
"description": "Array that contains one object per station as defined below.",
1927
"type": "object",
@@ -22,7 +30,7 @@
2230
"type": "array",
2331
"items": {
2432
"station_id": {
25-
"description": "identifier of a station.",
33+
"description": "Identifier of a station.",
2634
"type": "string"
2735
},
2836
"num_bikes_available": {
@@ -88,6 +96,7 @@
8896
"required": [
8997
"last_updated",
9098
"ttl",
99+
"version",
91100
"data"
92101
]
93102
}

system_alerts.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0",
25+
"2.1-RC",
26+
"2.1-RC2",
27+
"3.0-RC"
28+
]
29+
},
1730
"data": {
1831
"description": "Array that contains ad-hoc alerts for the system.",
1932
"type": "object",
@@ -109,6 +122,7 @@
109122
"required": [
110123
"last_updated",
111124
"ttl",
125+
"version",
112126
"data"
113127
]
114128
}

system_calendar.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0",
25+
"2.1-RC",
26+
"2.1-RC2",
27+
"3.0-RC"
28+
]
29+
},
1730
"data": {
1831
"description": "Array that contains opertions calendar for the system.",
1932
"type": "object",
@@ -72,6 +85,7 @@
7285
"required": [
7386
"last_updated",
7487
"ttl",
88+
"version",
7589
"data"
7690
]
7791
}

system_hours.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
"type": "integer",
1515
"minimum": 0
1616
},
17+
"version": {
18+
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
19+
"type": "string",
20+
"enum": [
21+
"1.1-RC",
22+
"1.1",
23+
"2.0-RC",
24+
"2.0",
25+
"2.1-RC",
26+
"2.1-RC2",
27+
"3.0-RC"
28+
]
29+
},
1730
"data": {
1831
"description": "Array that contains system hours of operations.",
1932
"type": "object",
@@ -79,6 +92,7 @@
7992
"required": [
8093
"last_updated",
8194
"ttl",
95+
"version",
8296
"data"
8397
]
84-
}
98+
}

0 commit comments

Comments
 (0)