Add rule_priority field to fare leg rule schema
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
- Tzu-Jen Chan ( tzujenchanmbd )
- May 23, 2024 @ 03:01 AM ETC (07:01 AM UTC)
MESSAGE
[GTFS-Fares v2] Add rule_priority to fare_leg_rules.txt (#418)
* Add fare_leg_rules.rule_priority
* Adjust description for rule_priority
* Modify file description
* Modify filed descriptions
* Add a sentence to fare_leg_rule file desc
Indicate fare_leg_rules handles empty in 2 ways
* Modify rule_priority description
Add a sentence to establish a validator rule (concern: producers just adding the field header without knowing it will change the existing empty semantics)
* editorial updates
* editorial update
* Revised typo "arrival"
* Allow adding empty column to turn off empty-value semantics
FILES CHANGED
https://github.com/google/transit/commit/d339c75488acae81cb88db62e3da480531f73782
https://github.com/google/transit/commit/d339c75488acae81cb88db62e3da480531f73782
@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.
@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?
Here is a spreadsheet-based dataset from Ito: https://docs.google.com/spreadsheets/d/1IVzSzmlK4PIo92xMvzOrwnZQvIX7ss0-FzN9GhjvvQ8/edit?gid=1013801825#gid=1013801825
Does the validator produce a InvalidRulePriorityNotice if rule priority is less than 0? @tzujenchanmbd
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?
Yes, we already have checks for non-negative values, so no more new notices to be added.