Skip to content

Commit 23d0663

Browse files
Add schemas for v2.1-RC (#34)
Add vehicle type definitions Add geofencing, virtual station, and dockless support
1 parent f882cf4 commit 23d0663

File tree

6 files changed

+409
-26
lines changed

6 files changed

+409
-26
lines changed

free_bike_status.json

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
1919
"type": "string",
2020
"enum": [
21-
"2.0"
21+
"2.1-RC"
2222
]
2323
},
2424
"data": {
@@ -72,26 +72,40 @@
7272
"format": "uri"
7373
}
7474
}
75-
}
75+
},
76+
"vehicle_type_id": {
77+
"description": "The vehicle_type_id of this vehicle (added in v2.1-RC).",
78+
"type": "string"
79+
},
80+
"last_reported": {
81+
"description": "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).",
82+
"type": "number",
83+
"minimum": 1450155600
84+
},
85+
"current_range_meters": {
86+
"description": "The furthest distance in meters that the vehicle can travel without recharging or refueling with the vehicle's current charge or fuel (added in v2.1-RC).",
87+
"type": "number",
88+
"minimum": 0
89+
},
90+
"required": [
91+
"bike_id",
92+
"lat",
93+
"lon",
94+
"is_reserved",
95+
"is_disabled"
96+
]
7697
},
7798
"required": [
78-
"bike_id",
79-
"lat",
80-
"lon",
81-
"is_reserved",
82-
"is_disabled"
99+
"bikes"
83100
]
84101
}
85102
},
86103
"required": [
87-
"bikes"
104+
"last_updated",
105+
"ttl",
106+
"version",
107+
"data"
88108
]
89109
}
90-
},
91-
"required": [
92-
"last_updated",
93-
"ttl",
94-
"version",
95-
"data"
96-
]
110+
}
97111
}

gbfs.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
1919
"type": "string",
2020
"enum": [
21-
"1.1-RC",
22-
"1.1",
23-
"2.0-RC",
24-
"2.0"
21+
"2.1-RC",
22+
"2.1-RC2",
23+
"3.0-RC",
24+
"3.0"
2525
]
2626
},
2727
"data": {
@@ -44,14 +44,16 @@
4444
"gbfs",
4545
"gbfs_versions",
4646
"system_information",
47+
"vehicle_types",
4748
"station_information",
4849
"station_status",
4950
"free_bike_status",
5051
"system_hours",
5152
"system_alerts",
5253
"system_calendar",
5354
"system_regions",
54-
"system_pricing_plans"
55+
"system_pricing_plans",
56+
"geofencing_zones"
5557
]
5658
},
5759
"url": {

geofencing_zones.json

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#geofencing_zonesjson",
4+
"description": "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).",
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+
"2.1-RC",
22+
"2.1-RC2",
23+
"2.1",
24+
"3.0-RC",
25+
"3.0"
26+
]
27+
},
28+
"data": {
29+
"description": "Array that contains geofencing information for the system.",
30+
"type": "object",
31+
"properties": {
32+
"geofencing_zones": {
33+
"type": "array",
34+
"items": {
35+
"type": {
36+
"description": "FeatureCollection as per IETF RFC 7946.",
37+
"type": "string",
38+
"enum": [
39+
"FeatureCollection"
40+
]
41+
},
42+
"features": {
43+
"description": "Array of objects.",
44+
"type": "array",
45+
"items": {
46+
"title": "GeoJSON Feature",
47+
"type": "object",
48+
"properties": {
49+
"type": {
50+
"type": "string",
51+
"enum": [
52+
"Feature"
53+
]
54+
},
55+
"properties": {
56+
"description": "Describing travel allowances and limitations.",
57+
"type": "object",
58+
"properties": {
59+
"name": {
60+
"description": "Public name of the geofencing zone.",
61+
"type": "string"
62+
},
63+
"start": {
64+
"description": "Start time of the geofencing zone in POSIX time.",
65+
"type": "number",
66+
"minimum": 1450155600
67+
},
68+
"end": {
69+
"description": "End time of the geofencing zone in POSIX time.",
70+
"type": "number",
71+
"minimum": 1450155600
72+
},
73+
"rules": {
74+
"description": "Array that contains one object per rule.",
75+
"type": "array",
76+
"items": {
77+
"vehicle_type_id": {
78+
"description": "Array of vehicle type IDs for which these restrictions apply.",
79+
"type": "array"
80+
},
81+
"ride_allowed": {
82+
"description": "Is the undocked ride allowed to stat and end in this zone?",
83+
"type": "boolean"
84+
},
85+
"ride_through_allowed": {
86+
"description": "Is the ride allowed to travel through this zone?",
87+
"type": "boolean"
88+
},
89+
"maximum_speed_kph": {
90+
"description": "What is the maximum speed allowed, in kilometers per hour?",
91+
"type": "number",
92+
"minimum": 0
93+
}
94+
}
95+
}
96+
},
97+
"required": [
98+
"ride_allowed",
99+
"ride_through_allowed"
100+
]
101+
},
102+
"geometry": {
103+
"description": "A polygon that describes where rides might not be able to start, end, go through, or have otehr limitations. Must follow the right-hand rule.",
104+
"title": "GeoJSON MultiPolygon",
105+
"type": "object",
106+
"properties": {
107+
"type": {
108+
"type": "string",
109+
"enum": [
110+
"MultiPolygon"
111+
]
112+
},
113+
"coordinates": {
114+
"type": "array",
115+
"items": {
116+
"type": "array",
117+
"items": {
118+
"type": "array",
119+
"minItems": 4,
120+
"items": {
121+
"type": "array",
122+
"minItems": 2,
123+
"items": {
124+
"type": "number"
125+
}
126+
}
127+
}
128+
}
129+
}
130+
},
131+
"required": [
132+
"type",
133+
"coordinates"
134+
]
135+
}
136+
}
137+
}
138+
}
139+
},
140+
"required": [
141+
"type",
142+
"geometry",
143+
"properties"
144+
]
145+
}
146+
}
147+
}
148+
},
149+
"required": [
150+
"last_updated",
151+
"ttl",
152+
"version",
153+
"data"
154+
]
155+
}

station_information.json

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
1919
"type": "string",
2020
"enum": [
21-
"1.1-RC",
22-
"1.1",
23-
"2.0-RC",
24-
"2.0"
21+
"2.1-RC"
2522
]
2623
},
2724
"data": {
@@ -89,11 +86,59 @@
8986
},
9087
"minItems": 1
9188
},
89+
"is_virtual_station": {
90+
"description": "Is this station a location with or without physical infrastructure? (added in v2.1-RC)",
91+
"type": "boolean"
92+
},
93+
"station_area": {
94+
"description": "A multipolygon that describes the area of a virtual station (added in v2.1-RC).",
95+
"type": "object",
96+
"required": [
97+
"type",
98+
"coordinates"
99+
],
100+
"properties": {
101+
"type": {
102+
"type": "string",
103+
"enum": [
104+
"Multipolygon"
105+
]
106+
},
107+
"coordinates": {
108+
"type": "array",
109+
"items": {
110+
"type": "array",
111+
"items": {
112+
"type": "array",
113+
"minItems": 4,
114+
"items": {
115+
"type": "array",
116+
"minItems": 2,
117+
"items": {
118+
"type": "number"
119+
}
120+
}
121+
}
122+
}
123+
}
124+
}
125+
},
92126
"capacity": {
93127
"description": "Number of total docking points installed at this station, both available and unavailable.",
94128
"type": "number",
95129
"minimum": 0
96130
},
131+
"vehicle_capacity": {
132+
"description": "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC).",
133+
"type": "object",
134+
"properties": {
135+
"type": "number"
136+
}
137+
},
138+
"is_valet_station": {
139+
"description": "Are valet services provided at this station? (added in v2.1-RC)",
140+
"type": "boolean"
141+
},
97142
"rental_uris": {
98143
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
99144
"type": "object",
@@ -114,6 +159,13 @@
114159
"format": "uri"
115160
}
116161
}
162+
},
163+
"vehicle_type_capacity": {
164+
"description": "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC).",
165+
"type": "object",
166+
"additionalProperties": {
167+
"type": "number"
168+
}
117169
}
118170
},
119171
"required": [

0 commit comments

Comments
 (0)