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

added support for v3.1-RC #185

Merged
merged 3 commits into from
May 27, 2024
Merged

added support for v3.1-RC #185

merged 3 commits into from
May 27, 2024

Conversation

Alessandro100
Copy link
Contributor

@Alessandro100 Alessandro100 commented May 23, 2024

Fixes #184

Added support for GBFS v3.1-RC

New custom rules added

  • [system_pricing_plans] reservation_price_per_min or reservation_price_flat_rate allowed in plans
  • [vehicle_types] if reservation_price_per_min or reservation_price_flat_rate is present in the associated vehicle type, then default_reserve_time becomes required

Key changed files
gbfs-validator/versions/partials/v3.1-RC/vehicle_types/default_reserve_time_require.js
gbfs-validator/gbfs.js

Key test files
gbfs-validator/test/fixtures/conditional_default_reserve_time.js
gbfs-validator/test/gbfs.test.js

References
https://gbfs.org/specification/
https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md

@Alessandro100 Alessandro100 requested a review from richfab May 23, 2024 18:26
@Alessandro100 Alessandro100 self-assigned this May 23, 2024
Copy link

netlify bot commented May 23, 2024

Deploy Preview for gbfs-validator ready!

Name Link
🔨 Latest commit 78b84d7
🔍 Latest deploy log https://app.netlify.com/sites/gbfs-validator/deploys/664f8b1239e96900088933d8
😎 Deploy Preview https://deploy-preview-185--gbfs-validator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +193 to +196
"dependencies": {
"reservation_price_flat_rate": { "not": { "required": ["reservation_price_per_min"] } },
"reservation_price_per_min": { "not": { "required": ["reservation_price_flat_rate"] } }
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@richfab I added this to the schema which says: either reservation_price_flat_rate or reservation_price_per_min is present but not both of them together. Let me know if an addition like this to the schema is possible or should this be done in the form of a validation patch

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice improvement! Great use of the JSON schema features. I'll add it to https://github.com/MobilityData/gbfs-json-schema. Thanks 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

PR is up for review: MobilityData/gbfs-json-schema#125

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are the schemas duplicated here? and in the schema repo? How do we make sure they don't diverge?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, currently the schemas in https://github.com/MobilityData/gbfs-validator/ are duplicated from https://github.com/MobilityData/gbfs-json-schema/.

Open to suggestions to make sure they are always in sync.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Two possible ways among others:

  • download them from the other repo (how it's done in entur validator)
  • use git submodule

Copy link
Contributor

@richfab richfab May 27, 2024

Choose a reason for hiding this comment

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

Created an issue for this: #186

Copy link
Contributor

@richfab richfab left a comment

Choose a reason for hiding this comment

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

LGTM 💯
Thanks @Alessandro100 🙏

@richfab richfab merged commit 9e2e7a2 into master May 27, 2024
7 checks passed
@richfab richfab deleted the feat/184-support-v31-rc branch May 27, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support v3.1-RC
3 participants