MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
284 stars 100 forks source link

Add rule_priority field to fare leg rule schema #1768

Closed mobilitydataio closed 1 month ago

mobilitydataio commented 4 months ago

Context

rule_priority has been adopted for Fares v2 into the specification. The fare leg rule schema should be updated in the validator to include this optional field.

Commit Nº 1

AUTHOR × DATE

https://github.com/google/transit/commit/d339c75488acae81cb88db62e3da480531f73782

emmambd commented 4 months ago

@tzujenchanmbd Thanks for reviewing this beforehand to clarify there's no new validation rules needed! One thing to note though - even if there's no additional rules required, we should still add new fields to the fareLegRule schema. I'll update this issue to note this.

emmambd commented 1 month ago

@qcdyx We can test this by making sure that rule_priority doesn't trigger unknown_field once the rule is modified.

@tzujenchanmbd Know of any feeds with this field?

tzujenchanmbd commented 1 month ago

Here is a spreadsheet-based dataset from Ito: https://docs.google.com/spreadsheets/d/1IVzSzmlK4PIo92xMvzOrwnZQvIX7ss0-FzN9GhjvvQ8/edit?gid=1013801825#gid=1013801825

qcdyx commented 1 month ago

Does the validator produce a InvalidRulePriorityNotice if rule priority is less than 0? @tzujenchanmbd

tzujenchanmbd commented 1 month ago

rule_priority is a non-negative integer field. There should be a notice if the value is negative. Do we have an existing rule for non-negative values?

qcdyx commented 1 month ago

Yes, we already have checks for non-negative values, so no more new notices to be added.