-
Notifications
You must be signed in to change notification settings - Fork 12
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 conditional requirement #59
Conversation
On `free_bike_status.json` + `vehicle_type_id` if has a `vehicle_types.json` + `current_range_meters` if the vehicle_type_id has not the `human` propulsion Set `vehicle_types.json` required if `free_bike_status.json` has `vehicle_type_id` issue #54
❌ Deploy Preview for competent-payne-690ca9 failed. 🔨 Explore the source changes: a0c3c1a 🔍 Inspect the deploy log: https://app.netlify.com/sites/competent-payne-690ca9/deploys/618bded48e6b140008d89b62 |
❌ Deploy Preview for kind-pike-a3f3f8 failed. 🔨 Explore the source changes: a0c3c1a 🔍 Inspect the deploy log: https://app.netlify.com/sites/kind-pike-a3f3f8/deploys/618bded40afd260008246b50 |
❌ Deploy Preview for wizardly-engelbart-5c48ca failed. 🔨 Explore the source changes: a0c3c1a 🔍 Inspect the deploy log: https://app.netlify.com/sites/wizardly-engelbart-5c48ca/deploys/618bded4ba9d810008c50f23 |
✔️ Deploy Preview for unruffled-hugle-914373 ready! 🔨 Explore the source changes: a0c3c1a 🔍 Inspect the deploy log: https://app.netlify.com/sites/unruffled-hugle-914373/deploys/618bded41238240007b943fa 😎 Browse the preview: https://deploy-preview-59--unruffled-hugle-914373.netlify.app |
✔️ Deploy Preview for wizardly-lichterman-770f54 canceled. 🔨 Explore the source changes: a0c3c1a 🔍 Inspect the deploy log: https://app.netlify.com/sites/wizardly-lichterman-770f54/deploys/618bded4c57924000748eb58 |
👋 @PierrickP. Thanks for working on this! I had a look at what "Conditionally Required" fields/files in GBFS that aren't covered by the JSON Schema.
|
closed for #63 |
Summary
On
free_bike_status.json
vehicle_type_id
if has avehicle_types.json
current_range_meters
if the vehicle_type_id has not thehuman
propulsionSet
vehicle_types.json
required iffree_bike_status.json
hasvehicle_type_id
issue #54
Updates (in todo)
I made a major change on the core.
Before, for each file we download the body then validate it individualy (with
checkFile
func).Now, we download all files (
getFile
), then after validate it (validationFile
). In this way, we can include conditionnal / additionnal validation.Schemas with dynamic parts
I kept in mind to try keeping json schemas untouched. They are intended to be defined in a remote repository (https://github.com/MobilityData/gbfs-json-schema) and only linked into the validation.
Some conditional validations (like the
current_range_meters
requirement if thepropulsion
of thevehicle_type_id
is nothuman
) seems not possible on json-schema and generic for all feeds.To be able to validated it, i "augment" (patch/merge) the json-schema with partials (see https://github.com/MobilityData/gbfs-validator/tree/conditionnal-requirement-54/gbfs-validator/schema/v2.2/partials) dynamically generated for the current feed.