gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

Add rule_priority field to fare leg rule schema

Open mobilitydataio opened this issue 1 year ago • 1 comments

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

mobilitydataio avatar May 24 '24 00:05 mobilitydataio

@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 avatar May 27 '24 21:05 emmambd

@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?

emmambd avatar Aug 23 '24 16:08 emmambd

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

tzujenchanmbd avatar Aug 26 '24 15:08 tzujenchanmbd

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

qcdyx avatar Aug 26 '24 16:08 qcdyx

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?

tzujenchanmbd avatar Aug 26 '24 16:08 tzujenchanmbd

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

qcdyx avatar Aug 26 '24 16:08 qcdyx