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

feat: Initial support for Fares v2 validation.

Open bdferris-v2 opened this issue 2 years ago • 1 comments

Per issue #1201, adds validation for files and fields added for Fares v2 base spec changes.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [x] Run the unit tests with gradle test to make sure you didn't break anything
  • [x] Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • [x] Linked all relevant issues

bdferris-v2 avatar Aug 05 '22 03:08 bdferris-v2

Initial draft, mostly to see what happens when validating a few existing feeds.

bdferris-v2 avatar Aug 05 '22 03:08 bdferris-v2

Now that #1248 has been committed and integrated, this PR is ready for official review.

bdferris-v2 avatar Sep 14 '22 22:09 bdferris-v2

fare_transfer_rule_forbidden_duration_limit

  • spec mention in fare_transfer_rules.duration_limit_type: Forbidden if fare_transfer_rules.duration_limit is empty.
  • pseudo code: If [fare_transfer_rules.duration_limit == '' and fare_transfer_rules.duration_limit_type != ''], trigger the notice

@isabelle-dr I think this has been already added with the FareTransferRuleDurationLimitWithoutTypeNotice here. Could you confirm this is what you were looking for?

maximearmstrong avatar Sep 27 '22 23:09 maximearmstrong

I believe @isabelle-dr was correct that I didn't have a validation check for when duration_limit_type was specified but duration_limit was not. I've added that now.

I believe all validation rules have documentation in RULES.md at this point. Let me know if you see things differently.

As for fare_rules.txt and fare_attributes.txt, those seem to be clarifications of the Fares V1 spec. I'm happy to add support for that, but I'd argue for splitting it out into a separate PR to keep things (relatively) focused. Thoughts?

bdferris-v2 avatar Sep 29 '22 20:09 bdferris-v2