MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
290 stars 101 forks source link

Only warn if feed_contact_email or url are both unset. #1423

Closed takohei closed 1 year ago

takohei commented 1 year ago

Describe the bug

Best Practice recommends that at least one of feed_contact_email and feed_contact_url be provided in feed_info.txt. https://gtfs.org/schedule/best-practices/#feed_infotxt

However, Validator raise a missing_recommended_field warning if either the email or the url is not provided.

Steps/Code to Reproduce

Validate test feed. https://github.com/MobilityData/gtfs-validator/files/11365074/akocity_with_email.zip

Tested version: 4.0.0

Expected Results

No missing_recommended_field warning.

It is inappropriate to recommend that both be set, since some agencies only publish either an email address or a web form as their contact information.

Actual Results

A "missing_recommended_field" raised as follows

filename csvRowNumber
"feed_info.txt" 2

Screenshots

No response

Files used

akocity_with_email.zip

Validator version

4.0.0

Operating system

Windows

Java version

No response

Additional notes

Warnings for missing recommended fields in feed_info.txt was requested. #885

In response to that request, the recommended annotation feature (#1149) and the missing_recommended_field warning (#1157) were added.

At that time, recommended annotations were added to feed_contact_email and feed_contact_url, so that each is checked independently. #1156

It would be better to remove the recommended annotations for feed_contact_email and feed_contact_url and then add a check that at least one of them is set.

welcome[bot] commented 1 year ago

Thanks for opening your first issue in this project! If you haven't already, you can join our slack and join the #gtfs-validators channel to meet our awesome community. Come say hi :wave:!

Welcome to the community and thank you for your engagement in open source! :tada:

isabelle-dr commented 1 year ago

Hello @takohei, thank you for opening this issue and providing all this context!

You're right, at least one of feed_contact_email and feed_contact_url should be provided in feed_info.txt, the validator should only give a warning if the two are missing. Thank you for flagging this, our team will look at this issue shortly.

l646505418 commented 1 year ago

Hi, @isabelle-dr ,for this issue, maybe can add a specific function after load issue to check the NoticeContainer and adjust validationNotice accordingly.