Skip to content

Commit

Permalink
Squashed 'gbfs-validator/versions/schemas/' changes from 5273f96..f43…
Browse files Browse the repository at this point in the history
…170e

f43170e V3.0-RC Schemas  (#79)
680df70 Update pr-to-project.yml
c2c30a2 Typo fix in geofencing_zones.json (#78)
c9be765 Create pr-to-project.yml
0a17875 Create issues-to-project.yml
30e5a3a Update README.md

git-subtree-dir: gbfs-validator/versions/schemas
git-subtree-split: f43170e95d0969922a200a512cc5ab494702f79c
  • Loading branch information
josee-sabourin committed Apr 25, 2023
1 parent 51aaaf7 commit fbec9c8
Show file tree
Hide file tree
Showing 16 changed files with 2,937 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/issues-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add issues to project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/MobilityData/projects/58
github-token: ${{ secrets.GBFS_REPOS_CURRENT_STATUS }}
17 changes: 17 additions & 0 deletions .github/workflows/pr-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Add PRs to project

on:
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.1
with:
# You can target a repository in a different organization to the issue
project-url: https://github.com/orgs/MobilityData/projects/58
github-token: ${{ secrets.GBFS_REPOS_CURRENT_STATUS }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# gbfs-json-schema
JSON Schema for [General Bikeshare Feed](https://github.com/NABSA/gbfs/blob/master/gbfs.md) Specification(GBFS) feeds, managed by MobilityData. The [gbfs-validator](https://github.com/MobilityData/gbfs-validator) links directly to them.
JSON Schema for [General Bikeshare Feed Specification(GBFS)](https://github.com/MobilityData/gbfs/blob/master/gbfs.md) feeds, managed by MobilityData. The [gbfs-validator](https://github.com/MobilityData/gbfs-validator) links directly to them.
2 changes: 1 addition & 1 deletion v2.3/geofencing_zones.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"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 start and end in this zone?",
"type": "boolean"
},
"ride_through_allowed": {
Expand Down
68 changes: 68 additions & 0 deletions v3.0-RC/gbfs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/NABSA/gbfs/blob/v3.0-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": "3.0-RC"
},
"data": {
"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",
"manifest",
"gbfs_versions",
"system_information",
"vehicle_types",
"station_information",
"station_status",
"vehicle_status",
"system_alerts",
"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"]
}
65 changes: 65 additions & 0 deletions v3.0-RC/gbfs_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id":
"https://github.com/NABSA/gbfs/blob/v3.0-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": "3.0-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.0",
"1.1",
"2.0",
"2.1",
"2.2",
"2.3",
"3.0-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"]
}
200 changes: 200 additions & 0 deletions v3.0-RC/geofencing_zones.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id":
"https://github.com/NABSA/gbfs/blob/v3.0-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": "3.0-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": "array",
"items": {
"type": "object",
"properties": {
"start": {
"description": "Start time of the alert.",
"type": "integer",
"minimum": 1450155600
},
"end": {
"description": "End time of the alert.",
"type": "integer",
"minimum": 1450155600
}
}
}
},
"start": {
"description": "Start time of the geofencing zone in POSIX time.",
"type": "integer",
"minimum": 1450155600
},
"end": {
"description": "End time of the geofencing zone in POSIX time.",
"type": "integer",
"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_start_allowed": {
"description": "Is the ride allowed to start in this zone?",
"type": "boolean"
},
"ride_end_allowed": {
"description": "Is the ride allowed to 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
},
"station_parking": {
"description": "Vehicle MUST be parked at stations defined in station_information.json within this geofence zone",
"type": "boolean"
}
},
"required": ["ride_start_allowed", "ride_end_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"]
},
"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_start_allowed": {
"description": "Is the ride allowed to start in this zone?",
"type": "boolean"
},
"ride_end_allowed": {
"description": "Is the ride allowed to 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
},
"station_parking": {
"description": "Vehicle MUST be parked at stations defined in station_information.json within this geofence zone",
"type": "boolean"
}
},
"required": ["ride_start_allowed", "ride_end_allowed", "ride_through_allowed"]
}
}
}
}
},
"required": ["last_updated", "ttl", "version", "data"]
}
Loading

0 comments on commit fbec9c8

Please sign in to comment.