You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the validator accepts last_updated datetimes that are in the future and it accepts end datetimes that are before the start datetime. This could be an issue for consuming applications.
In #106, validating Timestamps was proposed using imperative rules (in JavaScript). However, using schemas and patched schemas instead, would have the benefit of having the validation done by ajv and all the results as an output of ajv.
Please describe some potential solutions you have considered (even if they aren’t related to GBFS).
The format of Timestamp changed from POSIX to RFC3339 in MobilityData/gbfs#522 so we should use 2 different validation methods:
RFC3339 Timestamps (>= v3.0-RC) could be validated using ajv #formatMinimum/formatMaximum.
POSIX Timestamps (<= v2.3) could be validated using JSON Schema patching #Range.
We must make sure that we compare using the same timezones.
Timestamp fields that MUST NOT be in the future (ERROR)
- every file with last_updated field
- station_status.json#stations.last_reported
- vehicle_status.json#vehicles.last_reported
- system_alerts.json#alerts.last_updated
- system_information.json#terms_last_updated
- system_information.json#privacy_last_updated
Timestamp fields that SHOULD NOT be greater than 5 minutes ago (WARNING)
- every file with last_updated field
Some Timestamp fields have a dependency (end >= start) which could be validated using ajv $data reference:
What is the issue and why is it an issue?
Currently, the validator accepts
last_updated
datetimes that are in the future and it acceptsend
datetimes that are before thestart
datetime. This could be an issue for consuming applications.In #106, validating Timestamps was proposed using imperative rules (in JavaScript). However, using schemas and patched schemas instead, would have the benefit of having the validation done by ajv and all the results as an output of ajv.
Please describe some potential solutions you have considered (even if they aren’t related to GBFS).
The format of Timestamp changed from POSIX to RFC3339 in MobilityData/gbfs#522 so we should use 2 different validation methods:
We must make sure that we compare using the same timezones.
Timestamp fields that MUST NOT be in the future (ERROR)
Timestamp fields that SHOULD NOT be greater than 5 minutes ago (WARNING)
Some Timestamp fields have a dependency (end >= start) which could be validated using ajv $data reference:
Timestamp fields with a dependency (ERROR)
Implementation
The text was updated successfully, but these errors were encountered: