Comments (4)
While GBFS does allow for extensions outside of the spec, extensions should be prefixed with an underscore, which would make it possible to distinguish them from mis-named or mis-used attributes.
from gbfs-validator.
Hi @richtaylor-ito, thanks for opening this issue!
It seems like this can be handled with additional properties.
Adding the following property in the Json Schemas will flag additional properties.
"additionalProperties": false
But this would flag the extensions outside the spec as well...
@PierrickP any thoughts on how to solve this problem?
from gbfs-validator.
After trying it with an online Json Schema Validator, using "additionalProperties": false
works.
We would need to add it to all properties
levels in order to flag additional fields in all levels of the JSON file.
Here is the modified station_status
file that flags the additional field in Bcycle's feed:
{
"$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 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": "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": "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"
],
"additionalProperties": false
}
}
},
"required": ["stations"],
}
},
"required": ["last_updated", "ttl", "version", "data"],
}
from gbfs-validator.
Hello additionalProperties
should work and i think there are a tricks with a regex to only accept underscore prefixed key
from gbfs-validator.
Related Issues (20)
- Fix error when `manifest.json` file is not found
- Response code 500 on Link.city feeds HOT 2
- Allow vehicle_types_available to be empty
- gbfs.json present, all other files missing, validator says "valid" HOT 2
- Introduce a GBFS Validator API product offering HOT 1
- Response code 500 on the LINK Knoxville feed HOT 1
- Map may not be displayed when the feed has errors
- Create different error messages HOT 1
- Zoom on visualization only focuses on stations
- Major issue with static-server HOT 7
- Provide conditional local file based input/output parameters for CLI usage similar to the Canonical GTFS Validator HOT 4
- Data sanity rules HOT 2
- Human Friendly Error Messages
- Errors in the manifest file are not displayed
- Authentication is misspelled
- Object dependency relationships validation HOT 3
- Timestamp validation
- Conditional requirements validation
- Totals equal sums validation
- HTTP API with Custom Header HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gbfs-validator.