Skip to content

Commit

Permalink
Modify schemas for v1.1 (#32)
Browse files Browse the repository at this point in the history
Adds versions + changes to system_information
  • Loading branch information
josee-sabourin authored Oct 22, 2020
1 parent 754e502 commit cbc7c85
Show file tree
Hide file tree
Showing 11 changed files with 319 additions and 26 deletions.
54 changes: 42 additions & 12 deletions free_bike_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1"
]
},
"data": {
"description": "Array that contains one object per bike as defined below.",
"type": "object",
Expand Down Expand Up @@ -49,24 +57,46 @@
"minimum": 0,
"maximum": 1
},
"required": [
"bike_id",
"lat",
"lon",
"is_reserved",
"is_disabled"
]
"rental_uris": {
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
"type": "object",
"properties": {
"android": {
"description": "URI that can be passed to an Android app with an intent (added in v1.1).",
"type": "string",
"format": "uri"
},
"ios": {
"description": "URI that can be used on iOS to launch the rental app for this vehicle (added in v1.1).",
"type": "string",
"format": "uri"
},
"web": {
"description": "URL that can be used by a web browser to show more information about renting this vehicle (added in v1.1).",
"type": "string",
"format": "uri"
}
}
}
},
"required": [
"bikes"
"bike_id",
"lat",
"lon",
"is_reserved",
"is_disabled"
]
}
},
"required": [
"last_updated",
"ttl",
"data"
"bikes"
]
}
}
},
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
12 changes: 12 additions & 0 deletions gbfs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0"
]
},
"data": {
"description": "Response data in the form of name:value pairs.",
"type": "object",
Expand All @@ -32,6 +42,7 @@
"type": "string",
"enum": [
"gbfs",
"gbfs_versions",
"system_information",
"station_information",
"station_status",
Expand Down Expand Up @@ -66,6 +77,7 @@
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
78 changes: 78 additions & 0 deletions gbfs_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#gbfs_versionsjson-added-in-v11",
"description": "Lists all feed endpoints published according to version sof the GBFS documentation. (added in v1.1)",
"type": "object",
"properties": {
"last_updated": {
"description": "Last time the data in the feed was updated in POSIX time.",
"type": "integer",
"minimum": 1450155600
},
"ttl": {
"description": "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).",
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework.",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0",
"2.1-RC",
"2.1",
"3.0-RC",
"3.0"
]
},
"data": {
"description": "Response data in the form of name:value pairs.",
"type": "object",
"properties": {
"versions": {
"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.",
"type": "array",
"items": {
"type": "object",
"properties": {
"version": {
"description": "The semantic version of the feed in the form X.Y",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0",
"2.1-RC",
"2.1-RC2",
"3.0-RC",
"3.0"
]
},
"url": {
"description": "URL of the corresponding gbfs.json endpoint",
"type": "string",
"format": "uri"
}
},
"required": [
"version",
"url"
]
}
},
"required": true
},
"additionalProperties": false
}
},
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
56 changes: 44 additions & 12 deletions station_information.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0"
]
},
"data": {
"description": "Array that contains one object per station as defined below.",
"type": "object",
Expand Down Expand Up @@ -80,27 +90,49 @@
"minItems": 1
},
"capacity": {
"description": "Number of total docking points installed at this tation, both available and unavailable.",
"description": "Number of total docking points installed at this station, both available and unavailable.",
"type": "number",
"minimum": 0
},
"required": [
"station_id",
"name",
"lat",
"lon"
]
"rental_uris": {
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
"type": "object",
"properties": {
"android": {
"description": "URI that can be passed to an Android app with an intent (added in v1.1).",
"type": "string",
"format": "uri"
},
"ios": {
"description": "URI that can be used on iOS to launch the rental app for this station (added in v1.1).",
"type": "string",
"format": "uri"
},
"web": {
"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).",
"type": "string",
"format": "uri"
}
}
}
},
"required": [
"stations"
"station_id",
"name",
"lat",
"lon"
]
}
},
"required": [
"last_updated",
"ttl",
"data"
"stations"
]
}
}
},
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
11 changes: 10 additions & 1 deletion station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1"
]
},
"data": {
"description": "Array that contains one object per station as defined below.",
"type": "object",
Expand All @@ -22,7 +30,7 @@
"type": "array",
"items": {
"station_id": {
"description": "identifier of a station.",
"description": "Identifier of a station.",
"type": "string"
},
"num_bikes_available": {
Expand Down Expand Up @@ -88,6 +96,7 @@
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
14 changes: 14 additions & 0 deletions system_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0",
"2.1-RC",
"2.1-RC2",
"3.0-RC"
]
},
"data": {
"description": "Array that contains ad-hoc alerts for the system.",
"type": "object",
Expand Down Expand Up @@ -109,6 +122,7 @@
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
14 changes: 14 additions & 0 deletions system_calendar.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0",
"2.1-RC",
"2.1-RC2",
"3.0-RC"
]
},
"data": {
"description": "Array that contains opertions calendar for the system.",
"type": "object",
Expand Down Expand Up @@ -72,6 +85,7 @@
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
16 changes: 15 additions & 1 deletion system_hours.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"type": "integer",
"minimum": 0
},
"version": {
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
"1.1",
"2.0-RC",
"2.0",
"2.1-RC",
"2.1-RC2",
"3.0-RC"
]
},
"data": {
"description": "Array that contains system hours of operations.",
"type": "object",
Expand Down Expand Up @@ -79,6 +92,7 @@
"required": [
"last_updated",
"ttl",
"version",
"data"
]
}
}
Loading

0 comments on commit cbc7c85

Please sign in to comment.