Skip to content

Commit d4ce387

Browse files
Add schemas for v2.1-RC2 (#35)
Aggregate available vehicle types at a station Extend system_pricing_plans.json
1 parent 23d0663 commit d4ce387

File tree

4 files changed

+104
-11
lines changed

4 files changed

+104
-11
lines changed

free_bike_status.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#free_bike_statusjson",
4-
"description": "Describes the vehicles that are not at a station and are available for rent.",
4+
"description": "Describes the vehicles that are available for rent (as of v2.1-RC2).",
55
"type": "object",
66
"properties": {
77
"last_updated": {
@@ -18,7 +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-
"2.1-RC"
21+
"2.1-RC2",
22+
"2.1",
23+
"3.0-RC",
24+
"3.0"
2225
]
2326
},
2427
"data": {
@@ -87,10 +90,16 @@
8790
"type": "number",
8891
"minimum": 0
8992
},
93+
"station_id": {
94+
"description": "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).",
95+
"type": "string"
96+
},
97+
"pricing_plan_id": {
98+
"description": "The plan_id of the pricing plan this vehicle is eligible for (added in v2.1-RC2).",
99+
"type": "string"
100+
},
90101
"required": [
91102
"bike_id",
92-
"lat",
93-
"lon",
94103
"is_reserved",
95104
"is_disabled"
96105
]

station_information.json

Lines changed: 1 addition & 1 deletion
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.1-RC"
21+
"2.1-RC2"
2222
]
2323
},
2424
"data": {

station_status.json

Lines changed: 18 additions & 3 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.1-RC"
21+
"2.1-RC2"
2222
]
2323
},
2424
"data": {
@@ -36,7 +36,22 @@
3636
"description": "Number of vehicles of any type physically available for rental at the station.",
3737
"type": "number",
3838
"minimum": 0
39-
}, ,
39+
},
40+
"vehicles_types_available": {
41+
"description": "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).",
42+
"type": "array",
43+
"items": {
44+
"vehicle_type_id": {
45+
"description": "The vehicle_type_id of vehicle at the station (added in v2.1-RC).",
46+
"type": "string"
47+
},
48+
"count": {
49+
"description": "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).",
50+
"type": "number",
51+
"minimum": 0
52+
}
53+
}
54+
},
4055
"num_bikes_disabled": {
4156
"description": "Number of disabled vehicles of any type at the station.",
4257
"type": "number",
@@ -65,7 +80,7 @@
6580
"type": "boolean"
6681
},
6782
"last_reported": {
68-
"description": "The last time this station reported its status to the operator's backend.",
83+
"description": "The last time this station reported its status to the operator's backend in POSIX time.",
6984
"type": "number",
7085
"minimum": 1450155600
7186
},

system_pricing_plans.json

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +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-
"2.0-RC",
22-
"2.0",
23-
"2.1-RC"
21+
"2.1-RC2",
22+
"2.1",
23+
"3.0-RC",
24+
"3.0"
2425
]
2526
},
2627
"data": {
@@ -60,6 +61,74 @@
6061
"description": {
6162
"description": "Customer-readable description of the pricing plan.",
6263
"type": "string"
64+
},
65+
"per_km_pricing": {
66+
"description": "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).",
67+
"type": "array",
68+
"items": {
69+
"start": {
70+
"description": "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).",
71+
"type": "number",
72+
"minimum": 0
73+
},
74+
"rate": {
75+
"description": "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).",
76+
"type": "number"
77+
},
78+
"interval": {
79+
"description": "Interval in kilometers at which the rate of this segment is either reapplied indefinitely, or if defined, up until (but not including) end kilometer (added in v2.1-RC2).",
80+
"type": "number",
81+
"minimum": 0
82+
},
83+
"end": {
84+
"description": "The kilometer at which the rate will no longer apply (added in v2.1-RC2).",
85+
"type": "number",
86+
"minimum": 0
87+
}
88+
},
89+
"dependencies": {
90+
"per_km_pricing": [
91+
"start",
92+
"rate",
93+
"interval"
94+
]
95+
}
96+
},
97+
"per_min_pricing": {
98+
"description": "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).",
99+
"type": "array",
100+
"items": {
101+
"start": {
102+
"description": "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).",
103+
"type": "number",
104+
"minimum": 0
105+
},
106+
"rate": {
107+
"description": "Rate that is charged for each minute interval after the start (added in v2.1-RC2).",
108+
"type": "number"
109+
},
110+
"interval": {
111+
"description": "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).",
112+
"type": "number",
113+
"minimum": "0"
114+
},
115+
"end": {
116+
"description": "The minute at which the rate will no longer apply (added in v2.1-RC2).",
117+
"type": "number",
118+
"minimum": 0
119+
}
120+
},
121+
"dependencies": {
122+
"per_min_pricing": [
123+
"start",
124+
"rate",
125+
"interval"
126+
]
127+
}
128+
},
129+
"surge_pricing": {
130+
"description": "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)",
131+
"type": "boolean"
63132
}
64133
},
65134
"required": [

0 commit comments

Comments
 (0)