MobilityData / gbfs-validator

The canonical GBFS validator. Maintained by the GBFS community, facilitated by MobilityData.
https://gbfs-validator.mobilitydata.org/
Apache License 2.0
18 stars 12 forks source link

Add spec violation rules #141

Closed richfab closed 10 months ago

richfab commented 10 months ago

This PR follows https://github.com/MobilityData/gbfs-validator/pull/106.

  1. Brings all the code from https://github.com/MobilityData/gbfs-validator/pull/106.
  2. Removes the validation rules that are not in the spec, as agreed in https://github.com/MobilityData/gbfs-validator/pull/106#issuecomment-1728467525. The code removed can be found in https://github.com/MobilityData/gbfs-validator/pull/139.
  3. Collapses errors and warnings in the UI (they were expanded by default in https://github.com/MobilityData/gbfs-validator/pull/106)
Before After
image image

Feed used for screenshots: https://acoruna.publicbikesystem.net/customer/gbfs/v2/gbfs.json

netlify[bot] commented 10 months ago

Deploy Preview for gbfs-validator ready!

Name Link
Latest commit d271ba893a762e00a1714315e7cc6de98ec432a0
Latest deploy log https://app.netlify.com/sites/gbfs-validator/deploys/6544130a08b2b400080fbb26
Deploy Preview https://deploy-preview-141--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.

testower commented 10 months ago

One thing I should add in my quest for schema-centric validation is of course that the SHOULD/warning validations are hard to implement that way...

richfab commented 10 months ago

@testower I'm done applying the quick fixes from your suggestions. The other comments are beyond my technical knowledge. I will sync with @davidgamez about next steps. Thanks!

richfab commented 10 months ago

Thank you @tdelmas for the initial PR (https://github.com/MobilityData/gbfs-validator/pull/106) and @testower for the thorough PR review.

Based on the conversation following https://github.com/MobilityData/gbfs-validator/issues/153#issuecomment-1806145023, we want to try doing the validation of these new rules by generating new schemas via a builder or a template instead of using imperative rules (eg: JavaScript).

For this reason, I believe this PR can be closed in favor of the following issues:

Thank you!