From 60305d20fa8367ae71ffabcf5b75e8e2ef985274 Mon Sep 17 00:00:00 2001 From: isabelle-dr <63653518+isabelle-dr@users.noreply.github.com> Date: Tue, 23 Nov 2021 07:35:19 -0500 Subject: [PATCH] Json Schema update (#58) * Import validator schemas Delete files Replace per validator schemas Add a .gitignore file * Added descriptions in v1.0 * fix 2.1 geofencing_zones.json * fix error in system_pricing_plans for v2.1 and v2.2 * fix typo in vehicle_types_available in v2.1 and v2.2 * fix typo in geofencing_zones in v2.1 and v2.2 * fix error in system_calendar * define non negative integer as integer in json schema * fix typos in descriptions * Delete index.js * Add description in system_regions * fix version numbers * update id * Add v2.3RC files & update version numbers * Update the files to the 2.3-RC * add is_charging_station * remove vehicles from station_status.json --- .gitignore | 87 +++++++ gbfs_versions.json | 83 ------- station_status.json | 180 --------------- system_pricing_plans.json | 163 ------------- system_regions.json | 69 ------ v1.0/free_bike_status.json | 60 +++++ v1.0/gbfs.json | 50 ++++ v1.0/station_information.json | 98 ++++++++ v1.0/station_status.json | 84 +++++++ v1.0/system_alerts.json | 101 ++++++++ v1.0/system_calendar.json | 69 ++++++ system_hours.json => v1.0/system_hours.json | 72 ++---- v1.0/system_information.json | 77 +++++++ v1.0/system_pricing_plans.json | 73 ++++++ v1.0/system_regions.json | 45 ++++ v1.1/free_bike_status.json | 99 ++++++++ v1.1/gbfs.json | 76 +++++++ v1.1/gbfs_versions.json | 61 +++++ v1.1/station_information.json | 137 +++++++++++ v1.1/station_status.json | 105 +++++++++ v1.1/system_alerts.json | 116 ++++++++++ .../system_calendar.json | 63 ++--- v1.1/system_hours.json | 77 +++++++ .../system_information.json | 88 ++++--- v1.1/system_pricing_plans.json | 89 ++++++++ v1.1/system_regions.json | 53 +++++ v2.0/free_bike_status.json | 95 ++++++++ v2.0/gbfs.json | 76 +++++++ v2.0/gbfs_versions.json | 62 +++++ v2.0/station_information.json | 137 +++++++++++ v2.0/station_status.json | 98 ++++++++ v2.0/system_alerts.json | 116 ++++++++++ v2.0/system_calendar.json | 78 +++++++ v2.0/system_hours.json | 77 +++++++ v2.0/system_information.json | 152 +++++++++++++ v2.0/system_pricing_plans.json | 87 +++++++ v2.0/system_regions.json | 53 +++++ v2.1/free_bike_status.json | 117 ++++++++++ gbfs.json => v2.1/gbfs.json | 41 ++-- v2.1/gbfs_versions.json | 63 +++++ .../geofencing_zones.json | 103 ++++----- .../station_information.json | 89 ++++---- v2.1/station_status.json | 146 ++++++++++++ system_alerts.json => v2.1/system_alerts.json | 63 ++--- v2.1/system_calendar.json | 78 +++++++ v2.1/system_hours.json | 77 +++++++ v2.1/system_information.json | 152 +++++++++++++ v2.1/system_pricing_plans.json | 87 +++++++ v2.1/system_regions.json | 53 +++++ v2.1/vehicle_types.json | 81 +++++++ .../free_bike_status.json | 74 +++--- v2.2/gbfs.json | 78 +++++++ v2.2/gbfs_versions.json | 64 ++++++ v2.2/geofencing_zones.json | 150 ++++++++++++ v2.2/station_information.json | 192 ++++++++++++++++ v2.2/station_status.json | 146 ++++++++++++ v2.2/system_alerts.json | 116 ++++++++++ v2.2/system_calendar.json | 78 +++++++ v2.2/system_hours.json | 77 +++++++ v2.2/system_information.json | 152 +++++++++++++ v2.2/system_pricing_plans.json | 164 +++++++++++++ v2.2/system_regions.json | 53 +++++ v2.2/vehicle_types.json | 81 +++++++ v2.3-RC/free_bike_status.json | 127 +++++++++++ v2.3-RC/gbfs.json | 78 +++++++ v2.3-RC/gbfs_versions.json | 65 ++++++ v2.3-RC/geofencing_zones.json | 150 ++++++++++++ v2.3-RC/station_information.json | 197 ++++++++++++++++ v2.3-RC/station_status.json | 146 ++++++++++++ v2.3-RC/system_alerts.json | 116 ++++++++++ v2.3-RC/system_calendar.json | 78 +++++++ v2.3-RC/system_hours.json | 77 +++++++ v2.3-RC/system_information.json | 215 ++++++++++++++++++ v2.3-RC/system_pricing_plans.json | 164 +++++++++++++ v2.3-RC/system_regions.json | 53 +++++ v2.3-RC/vehicle_types.json | 133 +++++++++++ vehicle_types.json | 110 --------- 77 files changed, 6634 insertions(+), 956 deletions(-) create mode 100644 .gitignore delete mode 100644 gbfs_versions.json delete mode 100644 station_status.json delete mode 100644 system_pricing_plans.json delete mode 100644 system_regions.json create mode 100644 v1.0/free_bike_status.json create mode 100644 v1.0/gbfs.json create mode 100644 v1.0/station_information.json create mode 100644 v1.0/station_status.json create mode 100644 v1.0/system_alerts.json create mode 100644 v1.0/system_calendar.json rename system_hours.json => v1.0/system_hours.json (51%) create mode 100644 v1.0/system_information.json create mode 100644 v1.0/system_pricing_plans.json create mode 100644 v1.0/system_regions.json create mode 100644 v1.1/free_bike_status.json create mode 100644 v1.1/gbfs.json create mode 100644 v1.1/gbfs_versions.json create mode 100644 v1.1/station_information.json create mode 100644 v1.1/station_status.json create mode 100644 v1.1/system_alerts.json rename system_calendar.json => v1.1/system_calendar.json (56%) create mode 100644 v1.1/system_hours.json rename system_information.json => v1.1/system_information.json (51%) create mode 100644 v1.1/system_pricing_plans.json create mode 100644 v1.1/system_regions.json create mode 100644 v2.0/free_bike_status.json create mode 100644 v2.0/gbfs.json create mode 100644 v2.0/gbfs_versions.json create mode 100644 v2.0/station_information.json create mode 100644 v2.0/station_status.json create mode 100644 v2.0/system_alerts.json create mode 100644 v2.0/system_calendar.json create mode 100644 v2.0/system_hours.json create mode 100644 v2.0/system_information.json create mode 100644 v2.0/system_pricing_plans.json create mode 100644 v2.0/system_regions.json create mode 100644 v2.1/free_bike_status.json rename gbfs.json => v2.1/gbfs.json (59%) create mode 100644 v2.1/gbfs_versions.json rename geofencing_zones.json => v2.1/geofencing_zones.json (54%) rename station_information.json => v2.1/station_information.json (60%) create mode 100644 v2.1/station_status.json rename system_alerts.json => v2.1/system_alerts.json (62%) create mode 100644 v2.1/system_calendar.json create mode 100644 v2.1/system_hours.json create mode 100644 v2.1/system_information.json create mode 100644 v2.1/system_pricing_plans.json create mode 100644 v2.1/system_regions.json create mode 100644 v2.1/vehicle_types.json rename free_bike_status.json => v2.2/free_bike_status.json (51%) create mode 100644 v2.2/gbfs.json create mode 100644 v2.2/gbfs_versions.json create mode 100644 v2.2/geofencing_zones.json create mode 100644 v2.2/station_information.json create mode 100644 v2.2/station_status.json create mode 100644 v2.2/system_alerts.json create mode 100644 v2.2/system_calendar.json create mode 100644 v2.2/system_hours.json create mode 100644 v2.2/system_information.json create mode 100644 v2.2/system_pricing_plans.json create mode 100644 v2.2/system_regions.json create mode 100644 v2.2/vehicle_types.json create mode 100644 v2.3-RC/free_bike_status.json create mode 100644 v2.3-RC/gbfs.json create mode 100644 v2.3-RC/gbfs_versions.json create mode 100644 v2.3-RC/geofencing_zones.json create mode 100644 v2.3-RC/station_information.json create mode 100644 v2.3-RC/station_status.json create mode 100644 v2.3-RC/system_alerts.json create mode 100644 v2.3-RC/system_calendar.json create mode 100644 v2.3-RC/system_hours.json create mode 100644 v2.3-RC/system_information.json create mode 100644 v2.3-RC/system_pricing_plans.json create mode 100644 v2.3-RC/system_regions.json create mode 100644 v2.3-RC/vehicle_types.json delete mode 100644 vehicle_types.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..23c81e20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,87 @@ +# Ignore all IDEA files. Comment out the following line if you wish to ignore only particular files (listed below). +.idea/ + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/modules.xml +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +.idea/artifacts +.idea/compiler.xml +.idea/jarRepositories.xml +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# Gradle +.gradle +build/ + +# Inputs and outputs +/input/ +/output/ + +# Mac +*/.DS_Store +.DS_Store \ No newline at end of file diff --git a/gbfs_versions.json b/gbfs_versions.json deleted file mode 100644 index 9ce5dab3..00000000 --- a/gbfs_versions.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "$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", - "2.2", - "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", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] - }, - "url": { - "description": "URL of the corresponding gbfs.json endpoint", - "type": "string", - "format": "uri" - } - }, - "required": [ - "version", - "url" - ] - } - } - }, - "required": [ - "versions" - ], - "additionalProperties": false - } - }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -} \ No newline at end of file diff --git a/station_status.json b/station_status.json deleted file mode 100644 index 301ba3be..00000000 --- a/station_status.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_statusjson", - "description": "Describes the capacity and rental availability of the station", - "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 (added in v1.1).", - "type": "string", - "enum": [ - "2.1-RC2", - "2.1", - "2.2" - ] - }, - "data": { - "description": "Array that contains one object per station as defined below.", - "type": "object", - "properties": { - "stations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "station_id": { - "description": "Identifier of a station.", - "type": "string" - }, - "num_bikes_available": { - "description": "Number of vehicles of any type physically available for rental at the station.", - "type": "number", - "minimum": 0 - }, - "vehicles_types_available": { - "description": "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", - "type": "array", - "items": { - "type": "object", - "properties": { - "vehicle_type_id": { - "description": "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", - "type": "string" - }, - "count": { - "description": "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", - "type": "number", - "minimum": 0 - } - } - } - }, - "num_bikes_disabled": { - "description": "Number of disabled vehicles of any type at the station.", - "type": "number", - "minimum": 0 - }, - "num_docks_available": { - "description": "Number of functional docks physically at the station.", - "type": "number", - "minimum": 0 - }, - "num_docks_disabled": { - "description": "Number of empty but disabled docks at the station.", - "type": "number", - "minimum": 0 - }, - "is_installed": { - "description": "Is the station currently on the street?", - "type": "boolean" - }, - "is_renting": { - "description": "Is the station currently renting vehicles?", - "type": "boolean" - }, - "is_returning": { - "description": "Is the station accepting vehicle returns?", - "type": "boolean" - }, - "last_reported": { - "description": "The last time this station reported its status to the operator's backend in POSIX time.", - "type": "number", - "minimum": 1450155600 - }, - "vehicle_docks_available": { - "description": "Object displaying available docks by vehicle type (added in v2.1-RC).", - "type": "array", - "items": { - "type": "object", - "properties": { - "vehicle_type_ids": { - "description": "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", - "type": "array", - "items": { - "type": "string" - } - }, - "count": { - "description": "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", - "type": "number", - "minimum": 0 - } - } - }, - "dependencies": { - "vehicle_docks_available": [ - "vehicle_type_ids", - "count" - ] - } - }, - "vehicles": { - "description": "Array of objects containing data about a specific vehicle that is present at the docking station (added in v2.1-RC).", - "type": "array", - "items": { - "type": "object", - "properties": { - "bike_id": { - "description": "Rotated identifier of a vehicle (added in v2.1-RC).", - "type": "string" - }, - "is_reserved": { - "description": "Is the vehicle currently reserved for someone else? (added in v2.1-RC)", - "type": "boolean" - }, - "is_disabled": { - "description": "Is the vehicle currently disabled (broken)? (added in v2.1-RC)", - "type": "boolean" - }, - "vehicle_type_id": { - "description": "The vehicle_type_id of this vehicle as described in vehicle_types.json (added in v2.1-RC).", - "type": "string" - }, - "current_range_meters": { - "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).", - "type": "number", - "minimum": 0 - } - } - }, - "required": [ - "bike_id", - "is_reserved", - "is_disabled", - "vehicle_type_id" - ] - } - } - }, - "required": [ - "station_id", - "num_bikes_available", - "is_installed", - "is_renting", - "is_returning", - "last_reported" - ] - } - }, - "required": [ - "stations" - ] - } - }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -} \ No newline at end of file diff --git a/system_pricing_plans.json b/system_pricing_plans.json deleted file mode 100644 index f993d211..00000000 --- a/system_pricing_plans.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_pricing_plansjson", - "description": "Describes the pricing schemes of the system.", - "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 (added in v1.1).", - "type": "string", - "enum": [ - "2.2", - "3.0-RC", - "3.0" - ] - }, - "data": { - "description": "Array that contains one object per plan as defined below.", - "type": "object", - "properties": { - "plans": { - "type": "array", - "items": { - "type": "object", - "properties": { - "plan_id": { - "description": "Identifier of a pricing plan in the system.", - "type": "string" - }, - "url": { - "description": "URL where the customer can learn more about this pricing plan.", - "type": "string", - "format": "uri" - }, - "name": { - "description": "Name of this pricing plan.", - "type": "string" - }, - "currency": { - "description": "Currency used to pay the fare in ISO 4217 code.", - "type": "string", - "pattern": "^\\w{3}$" - }, - "price": { - "description": "Fare price.", - "type": "number", - "minimum": 0 - }, - "is_taxable": { - "description": "Will additional tax be added to the base price?", - "type": "boolean" - }, - "description": { - "description": "Customer-readable description of the pricing plan.", - "type": "string" - }, - "per_km_pricing": { - "description": "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", - "type": "array", - "items": { - "type": "object", - "properties": { - "start": { - "description": "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", - "type": "number", - "minimum": 0 - }, - "rate": { - "description": "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", - "type": "number" - }, - "interval": { - "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).", - "type": "number", - "minimum": 0 - }, - "end": { - "description": "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", - "type": "number", - "minimum": 0 - } - } - }, - "dependencies": { - "per_km_pricing": [ - "start", - "rate", - "interval" - ] - } - }, - "per_min_pricing": { - "description": "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", - "type": "array", - "items": { - "type": "object", - "properties": { - "start": { - "description": "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", - "type": "number", - "minimum": 0 - }, - "rate": { - "description": "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", - "type": "number" - }, - "interval": { - "description": "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", - "type": "number", - "minimum": 0 - }, - "end": { - "description": "The minute at which the rate will no longer apply (added in v2.1-RC2).", - "type": "number", - "minimum": 0 - } - } - }, - "dependencies": { - "per_min_pricing": [ - "start", - "rate", - "interval" - ] - } - }, - "surge_pricing": { - "description": "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", - "type": "boolean" - } - } - }, - "required": [ - "plan_id", - "name", - "currency", - "price", - "is_taxable", - "description" - ] - } - }, - "required": [ - "plans" - ] - } - }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -} diff --git a/system_regions.json b/system_regions.json deleted file mode 100644 index 3cf8efa3..00000000 --- a/system_regions.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_regionsjson", - "description": "Describes regions for a system that is broken up by geographic or political region.", - "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 (added in v1.1).", - "type": "string", - "enum": [ - "1.1-RC", - "1.1", - "2.0-RC", - "2.0", - "2.1-RC", - "2.1-RC2", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] - }, - "data": { - "type": "object", - "properties": { - "regions": { - "description": "Array of regions.", - "type": "array", - "items": { - "type":"object", - "properties": { - "region_id": { - "description": "identifier of the region.", - "type": "string" - }, - "name": { - "description": "Public name for this region.", - "type": "string" - } - }, - "required": [ - "region_id", - "name" - ] - } - } - }, - "required": [ - "regions" - ] - } - }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -} diff --git a/v1.0/free_bike_status.json b/v1.0/free_bike_status.json new file mode 100644 index 00000000..072f9b6d --- /dev/null +++ b/v1.0/free_bike_status.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#free_bike_statusjson", + "description": "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + } + }, + "required": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/gbfs.json b/v1.0/gbfs.json new file mode 100644 index 00000000..beb7cdb1 --- /dev/null +++ b/v1.0/gbfs.json @@ -0,0 +1,50 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#gbfsjson", + "description": "Auto-discovery file that links to all of the other files published by the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-zA-Z]{2}$": { + "type": "object", + "properties": { + "feeds": { + "description": "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["name", "url"] + } + } + }, + "required": ["feeds"] + }, + "required": true + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/station_information.json b/v1.0/station_information.json new file mode 100644 index 00000000..23379785 --- /dev/null +++ b/v1.0/station_information.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#station_informationjson", + "description": "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": "Cross street or landmark…the station is located.", + "type": "string" + }, + "region_id": { + "description": "Identifier of the region…the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + } + }, + "capacity": { + "description": "Number of total docking …ilable and unavailable.", + "type": "integer", + "minimum": 0 + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/station_status.json b/v1.0/station_status.json new file mode 100644 index 00000000..52e37f83 --- /dev/null +++ b/v1.0/station_status.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#station_statusjson", + "description": "Describes the capacity and rental availability of the station", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": "Number of disabled vehic…ny type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": "Number of functional doc…sically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "oneOf": [{ "type": "boolean" }, { "type": "number" }] + }, + "last_reported": { + "description": "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number" + } + }, + "required": [ + "station_id", + "num_bikes_available", + "num_docks_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/system_alerts.json b/v1.0/system_alerts.json new file mode 100644 index 00000000..3ed003ab --- /dev/null +++ b/v1.0/system_alerts.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "number", + "minimum": 0 + }, + "end": { + "type": "number", + "minimum": 0 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL where the customer can learn more information about this alert.", + "type": "string" + }, + "summary": { + "description": "A short summary of this …played to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": "Indicates the last time the info for the alert was updated.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/system_calendar.json b/v1.0/system_calendar.json new file mode 100644 index 00000000..38b3a0c9 --- /dev/null +++ b/v1.0/system_calendar.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains operations calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + }, + "minItems": 1 + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/system_hours.json b/v1.0/system_hours.json similarity index 51% rename from system_hours.json rename to v1.0/system_hours.json index dd7775e9..a3823903 100644 --- a/system_hours.json +++ b/v1.0/system_hours.json @@ -1,35 +1,20 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_hoursjson", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_hoursjson", "description": "Describes the system hours of operation.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "description": "Last time the data in the feed was updated in POSIX time.", "type": "integer", - "minimum": 1450155600 + "minimum": 0, + "maximum": 1924988399 }, "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 (added in v1.1).", - "type": "string", - "enum": [ - "1.1-RC", - "1.1", - "2.0-RC", - "2.0", - "2.1-RC", - "2.1-RC2", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] - }, "data": { "description": "Array that contains system hours of operations.", "type": "object", @@ -39,66 +24,39 @@ "items": { "type": "object", "properties": { - "user_types": { + "user_type": { "description": "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", "type": "array", "items": { "type": "string", - "enum": [ - "member", - "nonmember" - ] - }, - "minItems": 1, - "maxItems": 2 + "enum": ["member", "nonmember"] + } }, "days": { "description": "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", "type": "array", "items": { "type": "string", - "enum": [ - "sun", - "mon", - "tue", - "wed", - "thu", - "fri", - "sat" - ] - }, - "minItems": 1, - "maxItems": 7 + "enum": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"] + } }, "start_time": { "description": "Start time for the hours of operation of the system.", "type": "string", - "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + "pattern": "^[0-9]{2}:[0-9]{2}:[0-9]{2}$" }, "end_time": { "description": "End time for the hours of operation of the system.", "type": "string", - "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + "pattern": "^[0-9]{2}:[0-9]{2}:[0-9]{2}$" } }, - "required": [ - "user_types", - "days", - "start_time", - "end_time" - ] + "required": ["user_types", "days", "start_time", "end_time"] } } }, - "required": [ - "rental_hours" - ] + "required": ["rental_hours"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -} \ No newline at end of file + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/system_information.json b/v1.0/system_information.json new file mode 100644 index 00000000..4088102d --- /dev/null +++ b/v1.0/system_information.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_informationjson", + "description": "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2}$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "phone_number": { + "description": "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": "Email address actively monitored by the operator's customer service department.", + "type": "string" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string" + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/system_pricing_plans.json b/v1.0/system_pricing_plans.json new file mode 100644 index 00000000..5418c97e --- /dev/null +++ b/v1.0/system_pricing_plans.json @@ -0,0 +1,73 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": "URL where the customer c…bout this pricing plan.", + "type": "string" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "minLength": 3, + "maxLength": 3 + }, + "price": { + "description": "Fare price.", + "type": "number" + }, + "is_taxable": { + "description": "Will additional tax be added to the base price?", + "type": ["number"] + }, + "description": { + "description": "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.0/system_regions.json b/v1.0/system_regions.json new file mode 100644 index 00000000..8417829b --- /dev/null +++ b/v1.0/system_regions.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.0/gbfs.md#system_regionsjson", + "description": "Describes regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "last_updated": { + "description": "Last time the data in the feed was updated in POSIX time.", + "type": "integer", + "minimum": 0, + "maximum": 1924988399 + }, + "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 + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "data"] +} diff --git a/v1.1/free_bike_status.json b/v1.1/free_bike_status.json new file mode 100644 index 00000000..fa14c4b4 --- /dev/null +++ b/v1.1/free_bike_status.json @@ -0,0 +1,99 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are not at a station and are available for rent.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "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": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v1.1/gbfs.json b/v1.1/gbfs.json new file mode 100644 index 00000000..e7c3fc1e --- /dev/null +++ b/v1.1/gbfs.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files publiished by the system.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + }, + "required": true + } + }, + "required": true + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v1.1/gbfs_versions.json b/v1.1/gbfs_versions.json new file mode 100644 index 00000000..1d319ad4 --- /dev/null +++ b/v1.1/gbfs_versions.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/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", + "const": "1.1" + }, + "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", + ] + }, + "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"] +} diff --git a/v1.1/station_information.json b/v1.1/station_information.json new file mode 100644 index 00000000..aa014345 --- /dev/null +++ b/v1.1/station_information.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#station_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + }, + "minItems": 1 + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "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": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v1.1/station_status.json b/v1.1/station_status.json new file mode 100644 index 00000000..4de7dc7a --- /dev/null +++ b/v1.1/station_status.json @@ -0,0 +1,105 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availablility of the station", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": [ + "station_id", + "num_bikes_available", + "num_docks_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v1.1/system_alerts.json b/v1.1/system_alerts.json new file mode 100644 index 00000000..fbbaaf0b --- /dev/null +++ b/v1.1/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/system_calendar.json b/v1.1/system_calendar.json similarity index 56% rename from system_calendar.json rename to v1.1/system_calendar.json index e25103f8..3fc077ff 100644 --- a/system_calendar.json +++ b/v1.1/system_calendar.json @@ -1,34 +1,27 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_calendarjson", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_calendarjson", "description": "Describes the operating calendar for a system.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "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", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] + "const": "1.1" }, "data": { "description": "Array that contains opertions calendar for the system.", @@ -41,57 +34,45 @@ "properties": { "start_month": { "description": "Starting month for the system operations.", - "type": "number", - "maximum": 1, - "minimum": 12 + "type": "integer", + "minimum": 1, + "maximum": 12 }, "start_day": { "description": "Starting day for the system operations.", - "type": "number", - "maximum": 1, - "minimum": 31 + "type": "integer", + "minimum": 1, + "maximum": 31 }, "start_year": { "description": "Starting year for the system operations.", - "type": "number", + "type": "integer", "pattern": "^\\d{4}$" }, "end_month": { "description": "End month for the system operations.", - "type": "number", + "type": "integer", "minimum": 1, "maximum": 12 }, "end_day": { "description": "End day for the system operations.", - "type": "number", + "type": "integer", "minimum": 1, "maximum": 31 }, "end_year": { "description": "End year for the system operations.", - "type": "number", + "type": "integer", "pattern": "^\\d{4}$" } }, - "required": [ - "start_month", - "start_day", - "end_month", - "end_day" - ] + "required": ["start_month", "start_day", "end_month", "end_day"] } } }, - "required": [ - "calendars" - ] + "required": ["calendars"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v1.1/system_hours.json b/v1.1/system_hours.json new file mode 100644 index 00000000..16d7fee4 --- /dev/null +++ b/v1.1/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/system_information.json b/v1.1/system_information.json similarity index 51% rename from system_information.json rename to v1.1/system_information.json index 6c7a463f..1c6254f4 100644 --- a/system_information.json +++ b/v1.1/system_information.json @@ -1,42 +1,41 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_informationjson", - "description": "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "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", - "2.1-RC", - "2.1-RC2", - "2.1", - "2.2" - ] + "const": "1.1" }, "data": { "description": "Response data in the form of name:value pairs.", "type": "object", "properties": { "system_id": { - "description": "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", "type": "string" }, "language": { - "description": "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", "type": "string", "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" }, @@ -68,16 +67,19 @@ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" }, "phone_number": { - "description": "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", "type": "string" }, "email": { - "description": "Email address actively monitored by the operator's customer service department.", + "description": + "Email address actively monitored by the operator's customer service department.", "type": "string", "format": "email" }, "feed_contact_email": { - "description": "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", "type": "string", "format": "email" }, @@ -86,73 +88,65 @@ "type": "string" }, "license_url": { - "description": "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", "type": "string", "format": "uri" }, "rental_apps": { - "description": "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", "type": "object", "properties": { "android": { - "description": "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", "type": "object", "properties": { "store_uri": { - "description": "URI where the rental Android app can be downloaded from (added in v1.1).", + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", "type": "string", "format": "uri" }, "discovery_uri": { - "description": "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", "type": "string", "format": "uri" } }, "dependencies": { - "android": [ - "store_uri", - "discovery_uri" - ] + "android": ["store_uri", "discovery_uri"] } }, "ios": { - "description": "Contains rental information for the iOS platform (added in v1.1).", + "description": + "Contains rental information for the iOS platform (added in v1.1).", "type": "object", "properties": { "store_uri": { - "description": "URI where the rental iOS app can be downloaded from (added in v1.1).", + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", "type": "string", "format": "uri" }, "discovery_uri": { - "description": "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", "type": "string", "format": "uri" } }, "dependencies": { - "ios": [ - "store_uri", - "discovery_uri" - ] + "ios": ["store_uri", "discovery_uri"] } } } } }, - "required": [ - "system_id", - "language", - "name", - "timezone" - ] + "required": ["system_id", "language", "name", "timezone"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v1.1/system_pricing_plans.json b/v1.1/system_pricing_plans.json new file mode 100644 index 00000000..06d10303 --- /dev/null +++ b/v1.1/system_pricing_plans.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v1.1/system_regions.json b/v1.1/system_regions.json new file mode 100644 index 00000000..a169ddae --- /dev/null +++ b/v1.1/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v1.1/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "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 (added in v1.1).", + "type": "string", + "const": "1.1" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/free_bike_status.json b/v2.0/free_bike_status.json new file mode 100644 index 00000000..03589cd2 --- /dev/null +++ b/v2.0/free_bike_status.json @@ -0,0 +1,95 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are not at a station and are available for rent.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "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": ["bike_id", "lat", "lon", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/gbfs.json b/v2.0/gbfs.json new file mode 100644 index 00000000..b4765aa1 --- /dev/null +++ b/v2.0/gbfs.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files publiished by the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + }, + "required": true + } + }, + "required": true + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/gbfs_versions.json b/v2.0/gbfs_versions.json new file mode 100644 index 00000000..49f369f2 --- /dev/null +++ b/v2.0/gbfs_versions.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/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", + "const": "2.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", + "2.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"] +} diff --git a/v2.0/station_information.json b/v2.0/station_information.json new file mode 100644 index 00000000..0d3e7163 --- /dev/null +++ b/v2.0/station_information.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#station_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "KEY", + "CREDITCARD", + "PAYPASS", + "APPLEPAY", + "ANDROIDPAY", + "TRANSITCARD", + "ACCOUNTNUMBER", + "PHONE" + ] + }, + "minItems": 1 + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "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": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/station_status.json b/v2.0/station_status.json new file mode 100644 index 00000000..6c59a548 --- /dev/null +++ b/v2.0/station_status.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availablility of the station", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_alerts.json b/v2.0/system_alerts.json new file mode 100644 index 00000000..680a0c63 --- /dev/null +++ b/v2.0/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "SYSTEM_CLOSURE", + "STATION_CLOSURE", + "STATION_MOVE", + "OTHER" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_calendar.json b/v2.0/system_calendar.json new file mode 100644 index 00000000..3344b052 --- /dev/null +++ b/v2.0/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_hours.json b/v2.0/system_hours.json new file mode 100644 index 00000000..c0333278 --- /dev/null +++ b/v2.0/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_information.json b/v2.0/system_information.json new file mode 100644 index 00000000..588f05b3 --- /dev/null +++ b/v2.0/system_information.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "android": ["store_uri", "discovery_uri"] + } + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "ios": ["store_uri", "discovery_uri"] + } + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_pricing_plans.json b/v2.0/system_pricing_plans.json new file mode 100644 index 00000000..3bc8c24c --- /dev/null +++ b/v2.0/system_pricing_plans.json @@ -0,0 +1,87 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.0/system_regions.json b/v2.0/system_regions.json new file mode 100644 index 00000000..c678759a --- /dev/null +++ b/v2.0/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.0/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "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 (added in v1.1).", + "type": "string", + "const": "2.0" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/free_bike_status.json b/v2.1/free_bike_status.json new file mode 100644 index 00000000..eb73fe9f --- /dev/null +++ b/v2.1/free_bike_status.json @@ -0,0 +1,117 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "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" + } + } + }, + "vehicle_type_id": { + "description": + "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": + "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "type": "number", + "minimum": 1450155600 + }, + "current_range_meters": { + "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).", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": + "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + } + }, + "required": ["bike_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/gbfs.json b/v2.1/gbfs.json similarity index 59% rename from gbfs.json rename to v2.1/gbfs.json index b3099e86..fa2996e0 100644 --- a/gbfs.json +++ b/v2.1/gbfs.json @@ -1,30 +1,27 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#gbfsjson", - "description": "Auto-discovery file that links to all of the other files published by the system.", + "$id": "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", "type": "string", - "enum": [ - "2.1-RC", - "2.1-RC2", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] + "const": "2.1" }, "data": { "description": "Response data in the form of name:value pairs.", @@ -34,13 +31,15 @@ "type": "object", "properties": { "feeds": { - "description": "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", "type": "array", "items": { "type": "object", "properties": { "name": { - "description": "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", "type": "string", "enum": [ "gbfs", @@ -64,10 +63,7 @@ "format": "uri" } }, - "required": [ - "name", - "url" - ] + "required": ["name", "url"] } }, "required": true @@ -78,10 +74,5 @@ "additionalProperties": false } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v2.1/gbfs_versions.json b/v2.1/gbfs_versions.json new file mode 100644 index 00000000..998c750f --- /dev/null +++ b/v2.1/gbfs_versions.json @@ -0,0 +1,63 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/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", + "const": "2.1" + }, + "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", + "2.0", + "2.1", + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/geofencing_zones.json b/v2.1/geofencing_zones.json similarity index 54% rename from geofencing_zones.json rename to v2.1/geofencing_zones.json index a0e7cf4d..fc341de2 100644 --- a/geofencing_zones.json +++ b/v2.1/geofencing_zones.json @@ -1,45 +1,43 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#geofencing_zonesjson", - "description": "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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.", + "description": + "GBFS version number to which the feed conforms, according to the versioning framework.", "type": "string", - "enum": [ - "2.1-RC", - "2.1-RC2", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] + "const": "2.1" }, "data": { - "description": "Array that contains geofencing information for the system.", + "description": + "Array that contains geofencing information for the system.", "type": "object", "properties": { "geofencing_zones": { "type": "object", - "description": "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "description": + "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", "properties": { "type": { "description": "FeatureCollection as per IETF RFC 7946.", "type": "string", - "enum": [ - "FeatureCollection" - ] + "enum": ["FeatureCollection"] }, "features": { "description": "Array of objects.", @@ -50,12 +48,11 @@ "properties": { "type": { "type": "string", - "enum": [ - "Feature" - ] + "enum": ["Feature"] }, "properties": { - "description": "Describing travel allowances and limitations.", + "description": + "Describing travel allowances and limitations.", "type": "object", "properties": { "name": { @@ -63,58 +60,61 @@ "type": "string" }, "start": { - "description": "Start time of the geofencing zone in POSIX time.", + "description": + "Start time of the geofencing zone in POSIX time.", "type": "number", "minimum": 1450155600 }, "end": { - "description": "End time of the geofencing zone in POSIX time.", + "description": + "End time of the geofencing zone in POSIX time.", "type": "number", "minimum": 1450155600 }, "rules": { - "description": "Array that contains one object per rule.", + "description": + "Array that contains one object per rule.", "type": "array", "items": { - "type":"object", + "type": "object", "properties": { "vehicle_type_id": { "type": "array", - "description": "Array of vehicle type IDs for which these restrictions apply.", - "items": {"type": "string"} + "description": + "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } }, "ride_allowed": { - "description": "Is the undocked ride allowed to stat and end in this zone?", + "description": + "Is the undocked ride allowed to stat and end in this zone?", "type": "boolean" }, "ride_through_allowed": { - "description": "Is the ride allowed to travel through this zone?", + "description": + "Is the ride allowed to travel through this zone?", "type": "boolean" }, "maximum_speed_kph": { - "description": "What is the maximum speed allowed, in kilometers per hour?", - "type": "number", + "description": + "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", "minimum": 0 } }, - "required": [ - "ride_allowed", - "ride_through_allowed" - ] + "required": ["ride_allowed", "ride_through_allowed"] } } } }, "geometry": { - "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.", + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", "title": "GeoJSON MultiPolygon", "type": "object", "properties": { "type": { "type": "string", - "enum": [ - "MultiPolygon" - ] + "enum": ["MultiPolygon"] }, "coordinates": { "type": "array", @@ -134,32 +134,17 @@ } } }, - "required": [ - "type", - "coordinates" - ] + "required": ["type", "coordinates"] } }, - "required": [ - "type", - "geometry", - "properties" - ] + "required": ["type", "geometry", "properties"] } } }, - "required": [ - "type", - "features" - ] + "required": ["type", "features"] } } } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/station_information.json b/v2.1/station_information.json similarity index 60% rename from station_information.json rename to v2.1/station_information.json index cce1469b..c977cd8f 100644 --- a/station_information.json +++ b/v2.1/station_information.json @@ -1,30 +1,32 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_informationjson", - "description": "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#station_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", "type": "string", - "enum": [ - "2.1-RC2", - "2.1", - "2.2" - ] + "const": "2.1" }, "data": { - "description": "Array that contains one object per station as defined below.", + "description": + "Array that contains one object per station as defined below.", "type": "object", "properties": { "stations": { @@ -61,11 +63,13 @@ "type": "string" }, "cross_street": { - "description": "Cross street or landmark where the station is located.", + "description": + "Cross street or landmark where the station is located.", "type": "string" }, "region_id": { - "description": "Identifier of the region where the station is located.", + "description": + "Identifier of the region where the station is located.", "type": "string" }, "post_code": { @@ -91,22 +95,19 @@ "minItems": 1 }, "is_virtual_station": { - "description": "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", "type": "boolean" }, "station_area": { - "description": "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", "type": "object", - "required": [ - "type", - "coordinates" - ], + "required": ["type", "coordinates"], "properties": { "type": { "type": "string", - "enum": [ - "MultiPolygon" - ] + "enum": ["MultiPolygon"] }, "coordinates": { "type": "array", @@ -128,68 +129,64 @@ } }, "capacity": { - "description": "Number of total docking points installed at this station, both available and unavailable.", - "type": "number", + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", "minimum": 0 }, "vehicle_capacity": { - "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).", + "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).", "type": "object", "additionalProperties": { "type": "number" } }, "is_valet_station": { - "description": "Are valet services provided at this station? (added in v2.1-RC)", + "description": + "Are valet services provided at this station? (added in v2.1-RC)", "type": "boolean" }, "rental_uris": { - "description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "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).", + "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).", + "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).", + "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" } } }, "vehicle_type_capacity": { - "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).", + "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).", "type": "object", "additionalProperties": { "type": "number" } } }, - "required": [ - "station_id", - "name", - "lat", - "lon" - ] + "required": ["station_id", "name", "lat", "lon"] } } }, - "required": [ - "stations" - ] + "required": ["stations"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v2.1/station_status.json b/v2.1/station_status.json new file mode 100644 index 00000000..996cd72d --- /dev/null +++ b/v2.1/station_status.json @@ -0,0 +1,146 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "vehicle_docks_available": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/system_alerts.json b/v2.1/system_alerts.json similarity index 62% rename from system_alerts.json rename to v2.1/system_alerts.json index 278130cc..c1990012 100644 --- a/system_alerts.json +++ b/v2.1/system_alerts.json @@ -1,34 +1,26 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#system_alertsjson", + "$id": "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_alertsjson", "description": "Describes ad-hoc changes to the system.", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "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", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] + "const": "2.1" }, "data": { "description": "Array that contains ad-hoc alerts for the system.", @@ -54,7 +46,8 @@ ] }, "times": { - "description": "Array of objects indicating when the alert is in effect.", + "description": + "Array of objects indicating when the alert is in effect.", "type": "array", "items": { "type": "object", @@ -72,31 +65,33 @@ } }, "additionalItems": false, - "required": [ - "start" - ] + "required": ["start"] }, "station_ids": { - "description": "Array of identifiers of the stations for which this alert applies.", + "description": + "Array of identifiers of the stations for which this alert applies.", "type": "array", "items": { "type": "string" } }, "region_ids": { - "description": "Array of identifiers of the regions for which this alert applies.", + "description": + "Array of identifiers of the regions for which this alert applies.", "type": "array", "items": { "type": "string" } }, "url": { - "description": "URL where the customer can learn more information about this alert.", + "description": + "URL where the customer can learn more information about this alert.", "type": "string", "format": "uri" }, "summary": { - "description": "A short summary of this alert to be displayed to the customer.", + "description": + "A short summary of this alert to be displayed to the customer.", "type": "string" }, "description": { @@ -104,28 +99,18 @@ "type": "string" }, "last_updated": { - "description": "Indicates the last time the info for the alert was updated.", + "description": + "Indicates the last time the info for the alert was updated.", "type": "number", "minimum": 1450155600 } }, - "required": [ - "alert_id", - "type", - "summary" - ] + "required": ["alert_id", "type", "summary"] } } }, - "required": [ - "alerts" - ] + "required": ["alerts"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v2.1/system_calendar.json b/v2.1/system_calendar.json new file mode 100644 index 00000000..f7d7aaa7 --- /dev/null +++ b/v2.1/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/system_hours.json b/v2.1/system_hours.json new file mode 100644 index 00000000..682444a1 --- /dev/null +++ b/v2.1/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/system_information.json b/v2.1/system_information.json new file mode 100644 index 00000000..be5adf86 --- /dev/null +++ b/v2.1/system_information.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "android": ["store_uri", "discovery_uri"] + } + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "ios": ["store_uri", "discovery_uri"] + } + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/system_pricing_plans.json b/v2.1/system_pricing_plans.json new file mode 100644 index 00000000..39e727a8 --- /dev/null +++ b/v2.1/system_pricing_plans.json @@ -0,0 +1,87 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/system_regions.json b/v2.1/system_regions.json new file mode 100644 index 00000000..891e47b6 --- /dev/null +++ b/v2.1/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "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 (added in v1.1).", + "type": "string", + "const": "2.1" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.1/vehicle_types.json b/v2.1/vehicle_types.json new file mode 100644 index 00000000..23032e2b --- /dev/null +++ b/v2.1/vehicle_types.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.1/gbfs.md#vehicle_typesjson-added-in-v21-rc", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "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", + "const": "2.1" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "car", "moped", "other", "scooter"] + }, + "propulsion_type": { + "description": "The primary propulsion type of the vehicle.", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion"] + } + } + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/free_bike_status.json b/v2.2/free_bike_status.json similarity index 51% rename from free_bike_status.json rename to v2.2/free_bike_status.json index 65c44974..a4bee626 100644 --- a/free_bike_status.json +++ b/v2.2/free_bike_status.json @@ -1,36 +1,38 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#free_bike_statusjson", - "description": "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", "type": "object", "properties": { "last_updated": { - "description": "Last time the data in the feed was updated in POSIX time.", + "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).", + "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 (added in v1.1).", + "description": + "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).", "type": "string", - "enum": [ - "2.2", - "3.0-RC", - "3.0" - ] + "const": "2.2" }, "data": { - "description": "Array that contains one object per bike as defined below.", + "description": + "Array that contains one object per bike as defined below.", "type": "object", "properties": { "bikes": { "type": "array", "items": { - "type":"object", + "type": "object", "properties": { "bike_id": { "description": "Rotating (as of v2.0) identifier of a vehicle.", @@ -57,66 +59,64 @@ "type": "boolean" }, "rental_uris": { - "description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).", + "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).", + "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).", + "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).", + "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" } } }, "vehicle_type_id": { - "description": "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "description": + "The vehicle_type_id of this vehicle (added in v2.1-RC).", "type": "string" }, "last_reported": { - "description": "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "description": + "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", "type": "number", "minimum": 1450155600 }, "current_range_meters": { - "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).", + "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).", "type": "number", "minimum": 0 }, "station_id": { - "description": "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "description": + "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", "type": "string" }, "pricing_plan_id": { - "description": "The plan_id of the pricing plan this vehicle is eligible for (added in v2.1-RC2).", + "description": + "The plan_id of the pricing plan this vehicle is eligible for (added in v2.1-RC2).", "type": "string" } }, - "required": [ - "bike_id", - "is_reserved", - "is_disabled" - ] - }, - "required": [ - "bikes" - ] + "required": ["bike_id", "is_reserved", "is_disabled"] + } } - } + }, + "required": ["bikes"] } }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] + "required": ["last_updated", "ttl", "version", "data"] } diff --git a/v2.2/gbfs.json b/v2.2/gbfs.json new file mode 100644 index 00000000..d67b6d82 --- /dev/null +++ b/v2.2/gbfs.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + }, + "required": true + } + }, + "required": true + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/gbfs_versions.json b/v2.2/gbfs_versions.json new file mode 100644 index 00000000..ed0965df --- /dev/null +++ b/v2.2/gbfs_versions.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/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", + "const": "2.2" + }, + "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", + "2.0", + "2.1", + "2.2", + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/geofencing_zones.json b/v2.2/geofencing_zones.json new file mode 100644 index 00000000..12975a64 --- /dev/null +++ b/v2.2/geofencing_zones.json @@ -0,0 +1,150 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "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", + "const": "2.2" + }, + "data": { + "description": + "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": + "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": + "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "string" + }, + "start": { + "description": + "Start time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": + "End time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "rules": { + "description": + "Array that contains one object per rule.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "type": "array", + "description": + "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_allowed": { + "description": + "Is the undocked ride allowed to stat and end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": + "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": + "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + } + }, + "required": ["ride_allowed", "ride_through_allowed"] + } + } + } + }, + "geometry": { + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + } + } + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/station_information.json b/v2.2/station_information.json new file mode 100644 index 00000000..5d3e4294 --- /dev/null +++ b/v2.2/station_information.json @@ -0,0 +1,192 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#station_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_capacity": { + "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).", + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "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" + } + } + }, + "vehicle_type_capacity": { + "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).", + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/station_status.json b/v2.2/station_status.json new file mode 100644 index 00000000..2acbfe08 --- /dev/null +++ b/v2.2/station_status.json @@ -0,0 +1,146 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "vehicle_docks_available": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_alerts.json b/v2.2/system_alerts.json new file mode 100644 index 00000000..ddadf486 --- /dev/null +++ b/v2.2/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_calendar.json b/v2.2/system_calendar.json new file mode 100644 index 00000000..156c210d --- /dev/null +++ b/v2.2/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_hours.json b/v2.2/system_hours.json new file mode 100644 index 00000000..6b67bdaa --- /dev/null +++ b/v2.2/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_information.json b/v2.2/system_information.json new file mode 100644 index 00000000..43f0acd3 --- /dev/null +++ b/v2.2/system_information.json @@ -0,0 +1,152 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "android": ["store_uri", "discovery_uri"] + } + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "ios": ["store_uri", "discovery_uri"] + } + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_pricing_plans.json b/v2.2/system_pricing_plans.json new file mode 100644 index 00000000..3293848b --- /dev/null +++ b/v2.2/system_pricing_plans.json @@ -0,0 +1,164 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + }, + "per_km_pricing": { + "description": + "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "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).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "per_km_pricing": ["start", "rate", "interval"] + } + }, + "per_min_pricing": { + "description": + "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The minute at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "per_min_pricing": ["start", "rate", "interval"] + } + }, + "surge_pricing": { + "description": + "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", + "type": "boolean" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/system_regions.json b/v2.2/system_regions.json new file mode 100644 index 00000000..54d46676 --- /dev/null +++ b/v2.2/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "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 (added in v1.1).", + "type": "string", + "const": "2.2" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.2/vehicle_types.json b/v2.2/vehicle_types.json new file mode 100644 index 00000000..97bc8d61 --- /dev/null +++ b/v2.2/vehicle_types.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md#vehicle_typesjson-added-in-v21-rc", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "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", + "const": "2.2" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "car", "moped", "other", "scooter"] + }, + "propulsion_type": { + "description": "The primary propulsion type of the vehicle.", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion"] + } + } + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/free_bike_status.json b/v2.3-RC/free_bike_status.json new file mode 100644 index 00000000..214901e7 --- /dev/null +++ b/v2.3-RC/free_bike_status.json @@ -0,0 +1,127 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#free_bike_statusjson", + "description": + "Describes the vehicles that are available for rent (as of v2.1-RC2).", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": + "Array that contains one object per bike as defined below.", + "type": "object", + "properties": { + "bikes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "bike_id": { + "description": "Rotating (as of v2.0) identifier of a vehicle.", + "type": "string" + }, + "lat": { + "description": "The latitude of the vehicle.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude of the vehicle.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "is_reserved": { + "description": "Is the vehicle currently reserved?", + "type": "boolean" + }, + "is_disabled": { + "description": "Is the vehicle currently disabled (broken)?", + "type": "boolean" + }, + "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" + } + } + }, + "vehicle_type_id": { + "description": + "The vehicle_type_id of this vehicle (added in v2.1-RC).", + "type": "string" + }, + "last_reported": { + "description": + "The last time this vehicle reported its status to the operator's backend in POSIX time (added in v2.1-RC).", + "type": "number", + "minimum": 1450155600 + }, + "current_range_meters": { + "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).", + "type": "number", + "minimum": 0 + }, + "station_id": { + "description": + "Identifier referencing the station_id if the vehicle is currently at a station (added in v2.1-RC2).", + "type": "string" + }, + "home_station_id": { + "description": + "The station_id of the station this vehicle must be returned to (added in v2.3-RC).", + "type": "string" + }, + "pricing_plan_id": { + "description": + "The plan_id of the pricing plan this vehicle is eligible for (added in v2.1-RC2).", + "type": "string" + } + }, + "required": ["bike_id", "is_reserved", "is_disabled"] + } + } + }, + "required": ["bikes"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/gbfs.json b/v2.3-RC/gbfs.json new file mode 100644 index 00000000..649ff8a2 --- /dev/null +++ b/v2.3-RC/gbfs.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#gbfsjson", + "description": + "Auto-discovery file that links to all of the other files published by the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "patternProperties": { + "^[a-z]{2,3}(-[A-Z]{2})?$": { + "type": "object", + "properties": { + "feeds": { + "description": + "An array of all of the feeds that are published by the auto-discovery file. Each element in the array is an object with the keys below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": + "Key identifying the type of feed this is. The key must be the base file name defined in the spec for the corresponding feed type.", + "type": "string", + "enum": [ + "gbfs", + "gbfs_versions", + "system_information", + "vehicle_types", + "station_information", + "station_status", + "free_bike_status", + "system_hours", + "system_alerts", + "system_calendar", + "system_regions", + "system_pricing_plans", + "geofencing_zones" + ] + }, + "url": { + "description": "URL for the feed.", + "type": "string", + "format": "uri" + } + }, + "required": ["name", "url"] + } + }, + "required": true + } + }, + "required": true + }, + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/gbfs_versions.json b/v2.3-RC/gbfs_versions.json new file mode 100644 index 00000000..0af1be5e --- /dev/null +++ b/v2.3-RC/gbfs_versions.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/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", + "const": "2.3-RC" + }, + "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", + "2.0", + "2.1", + "2.2", + "2.3-RC" + ] + }, + "url": { + "description": "URL of the corresponding gbfs.json endpoint", + "type": "string", + "format": "uri" + } + }, + "required": ["version", "url"] + } + } + }, + "required": ["versions"], + "additionalProperties": false + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/geofencing_zones.json b/v2.3-RC/geofencing_zones.json new file mode 100644 index 00000000..c2897d5a --- /dev/null +++ b/v2.3-RC/geofencing_zones.json @@ -0,0 +1,150 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#geofencing_zonesjson", + "description": + "Describes geofencing zones and their associated rules and attributes (added in v2.1-RC).", + "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", + "const": "2.3-RC" + }, + "data": { + "description": + "Array that contains geofencing information for the system.", + "type": "object", + "properties": { + "geofencing_zones": { + "type": "object", + "description": + "Each geofenced zone and its associated rules and attributes is described as an object within the array of features.", + "properties": { + "type": { + "description": "FeatureCollection as per IETF RFC 7946.", + "type": "string", + "enum": ["FeatureCollection"] + }, + "features": { + "description": "Array of objects.", + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Feature"] + }, + "properties": { + "description": + "Describing travel allowances and limitations.", + "type": "object", + "properties": { + "name": { + "description": "Public name of the geofencing zone.", + "type": "string" + }, + "start": { + "description": + "Start time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": + "End time of the geofencing zone in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "rules": { + "description": + "Array that contains one object per rule.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "type": "array", + "description": + "Array of vehicle type IDs for which these restrictions apply.", + "items": { "type": "string" } + }, + "ride_allowed": { + "description": + "Is the undocked ride allowed to stat and end in this zone?", + "type": "boolean" + }, + "ride_through_allowed": { + "description": + "Is the ride allowed to travel through this zone?", + "type": "boolean" + }, + "maximum_speed_kph": { + "description": + "What is the maximum speed allowed, in kilometers per hour?", + "type": "integer", + "minimum": 0 + } + }, + "required": ["ride_allowed", "ride_through_allowed"] + } + } + } + }, + "geometry": { + "description": + "A polygon that describes where rides might not be able to start, end, go through, or have other limitations. Must follow the right-hand rule.", + "title": "GeoJSON MultiPolygon", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + }, + "required": ["type", "coordinates"] + } + }, + "required": ["type", "geometry", "properties"] + } + } + }, + "required": ["type", "features"] + } + } + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/station_information.json b/v2.3-RC/station_information.json new file mode 100644 index 00000000..0f34e4be --- /dev/null +++ b/v2.3-RC/station_information.json @@ -0,0 +1,197 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#station_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "name": { + "description": "Public name of the station.", + "type": "string" + }, + "short_name": { + "description": "Short name or other type of identifier.", + "type": "string" + }, + "lat": { + "description": "The latitude of the station.", + "type": "number", + "minimum": -90, + "maximum": 90 + }, + "lon": { + "description": "The longitude fo the station.", + "type": "number", + "minimum": -180, + "maximum": 180 + }, + "address": { + "description": "Address where station is located.", + "type": "string" + }, + "cross_street": { + "description": + "Cross street or landmark where the station is located.", + "type": "string" + }, + "region_id": { + "description": + "Identifier of the region where the station is located.", + "type": "string" + }, + "post_code": { + "description": "Postal code where station is located.", + "type": "string" + }, + "rental_methods": { + "description": "Payment methods accepted at this station.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "key", + "creditcard", + "paypass", + "applepay", + "androidpay", + "transitcard", + "accountnumber", + "phone" + ] + }, + "minItems": 1 + }, + "is_virtual_station": { + "description": + "Is this station a location with or without physical infrastructure? (added in v2.1-RC)", + "type": "boolean" + }, + "station_area": { + "description": + "A multipolygon that describes the area of a virtual station (added in v2.1-RC).", + "type": "object", + "required": ["type", "coordinates"], + "properties": { + "type": { + "type": "string", + "enum": ["MultiPolygon"] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } + }, + "capacity": { + "description": + "Number of total docking points installed at this station, both available and unavailable.", + "type": "integer", + "minimum": 0 + }, + "vehicle_capacity": { + "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).", + "type": "object", + "additionalProperties": { + "type": "number" + } + }, + "is_valet_station": { + "description": + "Are valet services provided at this station? (added in v2.1-RC)", + "type": "boolean" + }, + "is_charging_station": { + "description": + "Does the station support charging of electric vehicles? (added in v2.3-RC)", + "type": "boolean" + }, + "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" + } + } + }, + "vehicle_type_capacity": { + "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).", + "type": "object", + "additionalProperties": { + "type": "number" + } + } + }, + "required": ["station_id", "name", "lat", "lon"] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/station_status.json b/v2.3-RC/station_status.json new file mode 100644 index 00000000..503816a4 --- /dev/null +++ b/v2.3-RC/station_status.json @@ -0,0 +1,146 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#station_statusjson", + "description": + "Describes the capacity and rental availability of the station", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": + "Array that contains one object per station as defined below.", + "type": "object", + "properties": { + "stations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "station_id": { + "description": "Identifier of a station.", + "type": "string" + }, + "num_bikes_available": { + "description": + "Number of vehicles of any type physically available for rental at the station.", + "type": "integer", + "minimum": 0 + }, + "vehicle_types_available": { + "description": + "Array of objects displaying the total number of each vehicle type at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": + "The vehicle_type_id of vehicle at the station (added in v2.1-RC).", + "type": "string" + }, + "count": { + "description": + "A number representing the total amount of this vehicle type at the station (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + } + }, + "num_bikes_disabled": { + "description": + "Number of disabled vehicles of any type at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_available": { + "description": + "Number of functional docks physically at the station.", + "type": "integer", + "minimum": 0 + }, + "num_docks_disabled": { + "description": + "Number of empty but disabled docks at the station.", + "type": "integer", + "minimum": 0 + }, + "is_installed": { + "description": "Is the station currently on the street?", + "type": "boolean" + }, + "is_renting": { + "description": "Is the station currently renting vehicles?", + "type": "boolean" + }, + "is_returning": { + "description": "Is the station accepting vehicle returns?", + "type": "boolean" + }, + "last_reported": { + "description": + "The last time this station reported its status to the operator's backend in POSIX time.", + "type": "number", + "minimum": 1450155600 + }, + "vehicle_docks_available": { + "description": + "Object displaying available docks by vehicle type (added in v2.1-RC).", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_ids": { + "description": + "An array of strings where each string represents a vehicle_type_id that is able to use a particular type of dock at the station (added in v2.1-RC).", + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "description": + "A number representing the total number of available docks for the defined vehicle type (added in v2.1-RC).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "vehicle_docks_available": ["vehicle_type_ids", "count"] + } + } + }, + "required": [ + "station_id", + "num_bikes_available", + "is_installed", + "is_renting", + "is_returning", + "last_reported" + ] + } + } + }, + "required": ["stations"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_alerts.json b/v2.3-RC/system_alerts.json new file mode 100644 index 00000000..bf8620f0 --- /dev/null +++ b/v2.3-RC/system_alerts.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_alertsjson", + "description": "Describes ad-hoc changes to the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Array that contains ad-hoc alerts for the system.", + "type": "object", + "properties": { + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alert_id": { + "description": "Identifier for this alert.", + "type": "string" + }, + "type": { + "description": "Type of alert.", + "type": "string", + "enum": [ + "system_closure", + "station_closure", + "station_move", + "other" + ] + }, + "times": { + "description": + "Array of objects indicating when the alert is in effect.", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": "Start time of the alert.", + "type": "number", + "minimum": 1450155600 + }, + "end": { + "description": "End time of the alert.", + "type": "number", + "minimum": 1450155600 + } + } + }, + "additionalItems": false, + "required": ["start"] + }, + "station_ids": { + "description": + "Array of identifiers of the stations for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "region_ids": { + "description": + "Array of identifiers of the regions for which this alert applies.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": + "URL where the customer can learn more information about this alert.", + "type": "string", + "format": "uri" + }, + "summary": { + "description": + "A short summary of this alert to be displayed to the customer.", + "type": "string" + }, + "description": { + "description": "Detailed description of the alert.", + "type": "string" + }, + "last_updated": { + "description": + "Indicates the last time the info for the alert was updated.", + "type": "number", + "minimum": 1450155600 + } + }, + "required": ["alert_id", "type", "summary"] + } + } + }, + "required": ["alerts"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_calendar.json b/v2.3-RC/system_calendar.json new file mode 100644 index 00000000..53e5003b --- /dev/null +++ b/v2.3-RC/system_calendar.json @@ -0,0 +1,78 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_calendarjson", + "description": "Describes the operating calendar for a system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Array that contains opertions calendar for the system.", + "type": "object", + "properties": { + "calendars": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start_month": { + "description": "Starting month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "start_day": { + "description": "Starting day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "start_year": { + "description": "Starting year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + }, + "end_month": { + "description": "End month for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 12 + }, + "end_day": { + "description": "End day for the system operations.", + "type": "integer", + "minimum": 1, + "maximum": 31 + }, + "end_year": { + "description": "End year for the system operations.", + "type": "integer", + "pattern": "^\\d{4}$" + } + }, + "required": ["start_month", "start_day", "end_month", "end_day"] + } + } + }, + "required": ["calendars"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_hours.json b/v2.3-RC/system_hours.json new file mode 100644 index 00000000..354019e5 --- /dev/null +++ b/v2.3-RC/system_hours.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_hoursjson", + "description": "Describes the system hours of operation.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Array that contains system hours of operations.", + "type": "object", + "properties": { + "rental_hours": { + "type": "array", + "items": { + "type": "object", + "properties": { + "user_types": { + "description": + "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only.", + "type": "array", + "items": { + "type": "string", + "enum": ["member", "nonmember"] + }, + "minItems": 1, + "maxItems": 2 + }, + "days": { + "description": + "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies.", + "type": "array", + "items": { + "type": "string", + "enum": ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] + }, + "minItems": 1, + "maxItems": 7 + }, + "start_time": { + "description": + "Start time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + }, + "end_time": { + "description": + "End time for the hours of operation of the system.", + "type": "string", + "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$" + } + }, + "required": ["user_types", "days", "start_time", "end_time"] + } + } + }, + "required": ["rental_hours"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_information.json b/v2.3-RC/system_information.json new file mode 100644 index 00000000..376b50cf --- /dev/null +++ b/v2.3-RC/system_information.json @@ -0,0 +1,215 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_informationjson", + "description": + "Details including system operator, system location, year implemented, URL, contact info, time zone.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "system_id": { + "description": + "Identifier for this vehicle share system. This should be globally unique (even between different systems).", + "type": "string" + }, + "language": { + "description": + "The language that will be used throughout the rest of the files. It must match the value in the gbfs.json file.", + "type": "string", + "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$" + }, + "name": { + "description": "Name of the system to be displayed to customers.", + "type": "string" + }, + "short_name": { + "description": "Optional abbreviation for a system.", + "type": "string" + }, + "operator": { + "description": "Name of the operator", + "type": "string" + }, + "url": { + "description": "The URL of the vehicle share system.", + "type": "string", + "format": "uri" + }, + "purchase_url": { + "description": "URL where a customer can purchase a membership.", + "type": "string", + "format": "uri" + }, + "start_date": { + "description": "Date that the system began operations.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "phone_number": { + "description": + "A single voice telephone number for the specified system that presents the telephone number as typical for the system's service area.", + "type": "string" + }, + "email": { + "description": + "Email address actively monitored by the operator's customer service department.", + "type": "string", + "format": "email" + }, + "feed_contact_email": { + "description": + "A single contact email address for consumers of this feed to report technical issues (added in v1.1).", + "type": "string", + "format": "email" + }, + "timezone": { + "description": "The time zone where the system is located.", + "type": "string" + }, + "license_url": { + "description": + "A fully qualified URL of a page that defines the license terms for the GBFS data for this system.", + "type": "string", + "format": "uri" + }, + "brand_assets": { + "description": + "An object where each key defines one of the items listed below (added in v2.3-RC).", + "type": "object", + "properties": { + "brand_last_modified": { + "description": "Date that indicates the last time any included brand assets were updated (added in v2.3-RC).", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "brand_terms_url": { + "description": "A fully qualified URL pointing to the location of a page that defines the license terms of brand icons, colors or other trademark information (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "brand_image_url": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service (added in v2.3-RC). ", + "type": "string", + "format": "uri" + }, + "brand_image_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic file representing the brand for the service for use in dark mode (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "color": { + "description": "Color used to represent the brand for the service (added in v2.3-RC)", + "type": "string", + "pattern": "^#([a-fA-F0-9]{6})$" + } + }, + "dependencies":{ + "brand_assets": ["brand_last_modified", "brand_image_url"] + } + }, + "terms_url": { + "description": + "A fully qualified URL pointing to the terms of service (added in v2.3-RC)", + "type": "string", + "format": "uri" + }, + "terms_last_updated": { + "description": + "The date that the terms of service provided at terms_url were last updated (added in v2.3-RC)", + "type": "string", + "format": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "privacy_url": { + "description": + "A fully qualified URL pointing to the privacy policy for the service (added in v2.3-RC).", + "type": "string", + "format": "uri" + }, + "privacy_last_updated": { + "description": + "The date that the privacy policy provided at privacy_url was last updated (added in v2.3-RC).", + "type": "string", + "format": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "rental_apps": { + "description": + "Contains rental app information in the android and ios JSON objects (added in v1.1).", + "type": "object", + "properties": { + "android": { + "description": + "Contains rental app download and app discovery information for the Android platform. (added in v1.1)", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental Android app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental Android app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "android": ["store_uri", "discovery_uri"] + } + }, + "ios": { + "description": + "Contains rental information for the iOS platform (added in v1.1).", + "type": "object", + "properties": { + "store_uri": { + "description": + "URI where the rental iOS app can be downloaded from (added in v1.1).", + "type": "string", + "format": "uri" + }, + "discovery_uri": { + "description": + "URI that can be used to discover if the rental iOS app is installed on the device (added in v1.1).", + "type": "string", + "format": "uri" + } + }, + "dependencies": { + "ios": ["store_uri", "discovery_uri"] + } + } + } + } + }, + "required": ["system_id", "language", "name", "timezone"], + "dependencies": { + "terms_url": ["terms_last_updated"], + "privacy_url": ["privacy_last_updated"] + } + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_pricing_plans.json b/v2.3-RC/system_pricing_plans.json new file mode 100644 index 00000000..2fc60e3d --- /dev/null +++ b/v2.3-RC/system_pricing_plans.json @@ -0,0 +1,164 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_pricing_plansjson", + "description": "Describes the pricing schemes of the system.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": + "Array that contains one object per plan as defined below.", + "type": "object", + "properties": { + "plans": { + "type": "array", + "items": { + "type": "object", + "properties": { + "plan_id": { + "description": "Identifier of a pricing plan in the system.", + "type": "string" + }, + "url": { + "description": + "URL where the customer can learn more about this pricing plan.", + "type": "string", + "format": "uri" + }, + "name": { + "description": "Name of this pricing plan.", + "type": "string" + }, + "currency": { + "description": + "Currency used to pay the fare in ISO 4217 code.", + "type": "string", + "pattern": "^\\w{3}$" + }, + "price": { + "description": "Fare price.", + "type": "number", + "minimum": 0 + }, + "is_taxable": { + "description": + "Will additional tax be added to the base price?", + "type": "boolean" + }, + "description": { + "description": + "Customer-readable description of the pricing plan.", + "type": "string" + }, + "per_km_pricing": { + "description": + "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of kilometers that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each kilometer interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "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).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The kilometer at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "per_km_pricing": ["start", "rate", "interval"] + } + }, + "per_min_pricing": { + "description": + "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2).", + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "description": + "Number of minutes that have to elapse before this segment starts applying (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "rate": { + "description": + "Rate that is charged for each minute interval after the start (added in v2.1-RC2).", + "type": "number" + }, + "interval": { + "description": + "Interval in minutes at which the rate of this segment is either reapplied (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + }, + "end": { + "description": + "The minute at which the rate will no longer apply (added in v2.1-RC2).", + "type": "integer", + "minimum": 0 + } + } + }, + "dependencies": { + "per_min_pricing": ["start", "rate", "interval"] + } + }, + "surge_pricing": { + "description": + "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)", + "type": "boolean" + } + }, + "required": [ + "plan_id", + "name", + "currency", + "price", + "is_taxable", + "description" + ] + } + } + }, + "required": ["plans"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/system_regions.json b/v2.3-RC/system_regions.json new file mode 100644 index 00000000..7c9a19e6 --- /dev/null +++ b/v2.3-RC/system_regions.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#system_regionsjson", + "description": + "Describes regions for a system that is broken up by geographic or political region.", + "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 (added in v1.1).", + "type": "string", + "const": "2.3-RC" + }, + "data": { + "description": "Describe regions for a system that is broken up by geographic or political region.", + "type": "object", + "properties": { + "regions": { + "description": "Array of regions.", + "type": "array", + "items": { + "type": "object", + "properties": { + "region_id": { + "description": "identifier of the region.", + "type": "string" + }, + "name": { + "description": "Public name for this region.", + "type": "string" + } + }, + "required": ["region_id", "name"] + } + } + }, + "required": ["regions"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/v2.3-RC/vehicle_types.json b/v2.3-RC/vehicle_types.json new file mode 100644 index 00000000..a0fc2a18 --- /dev/null +++ b/v2.3-RC/vehicle_types.json @@ -0,0 +1,133 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": + "https://github.com/NABSA/gbfs/blob/v2.3-RC/gbfs.md#vehicle_typesjson-added-in-v21-rc", + "description": + "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", + "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", + "const": "2.3-RC" + }, + "data": { + "description": "Response data in the form of name:value pairs.", + "type": "object", + "properties": { + "vehicle_types": { + "description": + "Array that contains one object per vehicle type in the system as defined below.", + "type": "array", + "items": { + "type": "object", + "properties": { + "vehicle_type_id": { + "description": "Unique identifier of a vehicle type.", + "type": "string" + }, + "form_factor": { + "description": "The vehicle's general form factor.", + "type": "string", + "enum": ["bicycle", "car", "moped", "other", "scooter"] + }, + "propulsion_type": { + "description": "The primary propulsion type of the vehicle.", + "type": "string", + "enum": ["human", "electric_assist", "electric", "combustion"] + }, + "max_range_meters": { + "description": + "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", + "type": "number", + "minimum": 0 + }, + "name": { + "description": "The public name of this vehicle type.", + "type": "string" + }, + "default_reserve_time": { + "description": "Maximum time in minutes that a vehicle can be reserved before a rental begins added in v2.3-RC.", + "type": "integer", + "minimum": 0 + }, + "return_type": { + "description": "The conditions for returning the vehicle at the end of the trip added in v2.3-RC.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "free_floating", + "roundtrip_station", + "any_station" + ] + } + }, + "vehicle_assets": { + "description": "An object where each key defines one of the items listed below added in v2.3-RC.", + "type": "object", + "properties": { + "icon_url": { + "description": "A fully qualified URL pointing to the location of a graphic icon file that MAY be used to represent this vehicle type on maps and in other applications added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_url_dark": { + "description": "A fully qualified URL pointing to the location of a graphic icon file to be used to represent this vehicle type when in dark mode added in v2.3-RC.", + "type": "string", + "format": "uri" + }, + "icon_last_modified": { + "description": "Date that indicates the last time any included vehicle icon images were modified or updated added in v2.3-RC.", + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" + }, + "default_pricing_plan_id": { + "description": "A plan_id as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "string" + }, + "pricing_plan_ids": { + "description": "Array of all pricing plan IDs as defined in system_pricing_plans.json added in v2.3-RC.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "dependencies": { + "vehicle_assets": ["icon_url", "icon_last_modified"] + } + } + }, + "required": ["vehicle_type_id", "form_factor", "propulsion_type"], + "if": { + "properties": { + "propulsion_type": { + "enum": ["electric", "electric_assist", "combustion"] + } + } + }, + "then": { + "required": ["max_range_meters"] + } + } + } + }, + "required": ["vehicle_types"] + } + }, + "required": ["last_updated", "ttl", "version", "data"] +} diff --git a/vehicle_types.json b/vehicle_types.json deleted file mode 100644 index f7f2c2a8..00000000 --- a/vehicle_types.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://github.com/NABSA/gbfs/blob/master/gbfs.md#vehicle_typesjson-added-in-v21-rc", - "description": "Describes the types of vehicles that System operator has available for rent (added in v2.1-RC).", - "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": [ - "2.1-RC", - "2.1", - "2.2", - "3.0-RC", - "3.0" - ] - }, - "data": { - "description": "Response data in the form of name:value pairs.", - "type": "object", - "properties": { - "vehicle_types": { - "description": "Array that contains one object per vehicle type in the system as defined below.", - "type": "array", - "items": { - "type": "object", - "properties": { - "vehicle_type_id": { - "description": "Unique identifier of a vehicle type.", - "type": "string" - }, - "form_factor": { - "description": "The vehicle's general form factor.", - "type": "string", - "enum": [ - "bicycle", - "car", - "moped", - "other", - "scooter" - ] - }, - "propulsion_type": { - "description": "The primary propulsion type of the vehicle.", - "type": "string", - "enum": [ - "human", - "electric_assist", - "electric", - "combustion" - ] - }, - "max_range_meters": { - "description": "The furthest distance in meters that the vehicle can travel without recharging or refueling when it has the maximum amount of energy potential.", - "type": "number", - "minimum": 0 - }, - "name": { - "description": "The public name of this vehicle type.", - "type": "string" - } - }, - "required": [ - "vehicle_type_id", - "form_factor", - "propulsion_type" - ] - }, - "if": { - "properties": { - "propulsion_type": { - "const": [ - "electric", - "electric_assist", - "combustion" - ] - } - } - }, - "then": { - "properties": { - "max_range_meters": { - "required": [ - "max_range_meters" - ] - } - } - } - } - }, - "required": ["vehicle_types"] - } - }, - "required": [ - "last_updated", - "ttl", - "version", - "data" - ] -}