Skip to content

Create a @RecommendedColumn annotation #1350

@isabelle-dr

Description

@isabelle-dr

Context

The spec requires certain columns, but having an empty value in them is valid (example transfers.transfer_type).
The fact that we only had the @Required annotation, used in the schema files created false positives.

  @Required
  GtfsTransferType transferType();

This is why the awesome @briandonahue created a new @RequiredColumn annotation in #1344, designed especially for the case where the column itself is required, but some of the fields can be empty.

  @RequiredColumn
  GtfsTransferType transferType();

Proposition

We have a similar situation with stop_times.timepoint, except it's not a requirement but rather a recommendation. The GTFS Best Practice mentions (EDIT: they mentioned, it looks like we had another accidental removal in MobilityData/GTFS_Schedule_Best-Practices#44, I am working on it 😅) that the timepoint should be provided, although the values can be empty under certain conditions.

In the validator, we have a missing_timepoint_column notice that looks for the presence of the column
For consistency with the work done in #1344, we could replace this notice with a missing_recommended_column using a @RecommendedColumn.

Alternatives considered

Keep the validator as-is. I acknowledge this item doesn't add much to the user experience but figured this validator might be easier to maintain if we made this consistent (developers, I would love your POV).
Additionally, we might want to use the @RecommendedColumn for other fields than stop_times.timepoint in the future.

Metadata

Metadata

Assignees

Labels

enhancementNew feature request or improvement on an existing featuregood first issueGood task for newcomers to work on.status: ReadyAn issue that is ready to be worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions