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

Data sanity rules #138

Open richfab opened 10 months ago

richfab commented 10 months ago

What is the issue and why is it an issue?

Following the discussion in https://github.com/MobilityData/gbfs-validator/pull/106, consensus was reached to create a separate issue to discuss whether rules that verify data sanity should be added to the validator (ie: validation rules that are not part of the spec).

Examples of data sanity rules can be:

Open questions are:

Please describe some potential solutions you have considered (even if they aren’t related to GBFS).

The code for a dozen data sanity rules can be found in the commits of https://github.com/MobilityData/gbfs-validator/pull/106. This code will be removed from that PR to separate data sanity rules (not part of the spec) and data compliance rules (part of the spec).

tdelmas commented 10 months ago
  • the last_updated timestamp should not be in the future

As the specification says about last_updated: "Indicates the last time data in the feed was updated. ", I would argue that alast_updated in the future does break the specification.

A clearer example of "validation rules that are not part of the spec" could be "the unlock price is < 100€": that rule is not part of the specification, but could detect systems where "€ cents" and € were confused.

richfab commented 10 months ago

I would argue that a last_updated in the future does break the specification.

You are right @tdelmas. I have updated the issue descriptions to keep this rule in https://github.com/MobilityData/gbfs-validator/pull/106. Thank you!