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

Flex: Update stop schema and add missing_stop_id rule #1754

Closed emmambd closed 4 months ago

emmambd commented 4 months ago

Describe the problem

In order to support Flex as a part of https://github.com/MobilityData/gtfs-validator/issues/1721, we need to

1) modify the stop schema so stop_id is no longer a required field 2) add a new rule for missing_stop_id and checks for ids across stop_id, location_group_id, and locations.id

Proposed solution

File name Spec language Notice to update or add Validator logic Notice table columns
stops.txt, location_groups.txt, locations.geojson In stops.txt:

stop_id

ID must be unique across all `stops.stop_id`, locations.geojson `id`, and `location_groups.location_group_id` values.

In stop_times.txt:

stop_id **Required** if `stop_times.location_group_id` AND `stop_times.location_id` are NOT defined.
-

New notice to address use case that was previously covered in missing_required_field:

missing_stop_id

ERROR: Generate if there is no stop_id, location_group_id, OR location_id


Description should specify that the producer should add stop_id to stops.txt

lineNumber and tripId

Alternatives you've considered

No response

Additional context

This seems to be the most substantial change to the previous files and requirements of the spec from the new Flex changes. We're curious to hear from consumers about this modification and the work required for them to incorporate this change.

davidgamez commented 4 months ago

Tasks:

emmambd commented 4 months ago

After further clarification, this change is not required. stop_id is still required in all cases where stops.txt is still provided. The decision to define stops.txt as conditionally required is an ongoing discussion in the spec: https://github.com/google/transit/issues/452