Skip to content

Best Practice: Include agency_id in routes.txt (WARNING) #878

@e-lo

Description

@e-lo

Including agency_id in routes.txt is a best practice and should generate a warning even though it is not required if there is only one.

Implementatin thoughts:
Rather than returning here in this override, generate a WARNING.

public void validate(NoticeContainer noticeContainer) {
if (agencyTable.entityCount() < 2) {
// routes.agency_id is not required when there is a single agency.
return;
}
for (GtfsRoute route : routeTable.getEntities()) {
if (!route.hasAgencyId()) {
noticeContainer.addValidationNotice(
new MissingRequiredFieldNotice(
routeTable.gtfsFilename(),
route.csvRowNumber(),
GtfsRouteTableLoader.AGENCY_ID_FIELD_NAME));
}
// No need to check reference integrity because it is done by a validator generated from

Metadata

Metadata

Labels

GTFS Best PracticesUsed for Adding or changing rules that belong in the GTFS Best Practicesgood first issueGood task for newcomers to work on.new ruleNew rule to be addedstatus: In review

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions