Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schemas for v2.0 #33

Merged
merged 5 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions free_bike_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"description": "GBFS version number to which the feed conforms, according to the versioning framework (added in v1.1).",
"type": "string",
"enum": [
"1.1-RC",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep all previous valid versions in the enum here, so it should include 1.0, 1.1-RC, 1.1, v2.0-RC in addition to 2.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why the versions should be included, this schema would not be representative of a v1.0 dataset, can you explain the reasoning to me?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could go either way, depending on how we want to use the schema.

I would thinking primarily in context of generating software to generate, parse or validate feeds from the schema, where you would need to know what the universe of valid version numbers are at a given GBFS version. For example, there should only be breaking schema changes between major versions (e.g., changing booleans from 0/1 to true/false between v1 and v2). So you could use a v1.1 schema to validate, parse and generate a v1.0 feed as well as a v1.1 feed. And if the changes are only semantic (e.g., ID fields must be rotated for floating bikes) and the data types don't change, you could use a single schema (and generated software) to work across multiple major release versions too. So basically it would potentially be less software to maintain for people generating software from the schema.

But you could also make the argument that we want to keep a strict 1:1 mapping between the schema and it's version, so it can only be used for the same version feeds.

Maybe a question for the community and how they plan to use the schemas? In the meantime it's fine if you want to keep it showing only the latest version.

"1.1"
"2.0"
]
josee-sabourin marked this conversation as resolved.
Show resolved Hide resolved
},
"data": {
Expand Down Expand Up @@ -47,15 +46,11 @@
},
"is_reserved": {
"description": "Is the vehicle currently reserved?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"is_disabled": {
"description": "Is the vehicle currently disabled (broken)?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"rental_uris": {
"description": "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1).",
Expand All @@ -81,8 +76,6 @@
},
"required": [
"bike_id",
"lat",
josee-sabourin marked this conversation as resolved.
Show resolved Hide resolved
"lon",
"is_reserved",
"is_disabled"
]
Expand Down
16 changes: 4 additions & 12 deletions station_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"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"
josee-sabourin marked this conversation as resolved.
Show resolved Hide resolved
]
},
"data": {
Expand Down Expand Up @@ -55,21 +54,15 @@
},
"is_installed": {
"description": "Is the station currently on the street?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"is_renting": {
"description": "Is the station currently renting vehicles?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"is_returning": {
"description": "Is the station accepting vehicle returns?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"last_reported": {
"description": "The last time this station reported its status to the operator's backend.",
Expand All @@ -80,7 +73,6 @@
"required": [
"station_id",
"num_bikes_available",
"num_docks_available",
josee-sabourin marked this conversation as resolved.
Show resolved Hide resolved
"is_installed",
"is_renting",
"is_returning",
Expand Down
9 changes: 4 additions & 5 deletions system_pricing_plans.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"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",
josee-sabourin marked this conversation as resolved.
Show resolved Hide resolved
"2.0",
"2.1-RC"
]
},
"data": {
Expand Down Expand Up @@ -54,9 +55,7 @@
},
"is_taxable": {
"description": "Will additional tax be added to the base price?",
"type": "number",
"minimum": 0,
"maximum": 1
"type": "boolean"
},
"description": {
"description": "Customer-readable description of the pricing plan.",
Expand Down