-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify @Required annotations for validation #1343
Comments
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 👋! |
@isabelle-dr mentioned another scenario in #1350 regarding a warning for a Currently we have the following: Current:
I propose splitting the Proposal:
One potential consideration is documenting these in From a development standpoint I think the proposal is much clearer as long as we feel we can document the errors effectively. |
Describe the problem
Currently the
@Required
annotation is used on the schema files both at a Class level (for required files) and the Property level (for required fields). This can be confusing and recently, we in #1198 we had a scenario where a column was required, but it was not required that the field have data for the column. We discussed adding a new annotation when a column Header is required, but the column data can be empty (not required), which led to discussion of the existing@Required
annotation.Proposed solution
I think for additional clarity, it would make sense to break the original
@Required
header into two:@RequiredFile
- when the file can not be missing from the feed (valid on the schema Class)@RequiredValue
- when a value is required for the field (@RequiredColumn
- when the column (header) is required, but the field (value) is allowed to be emptyAlternatives you've considered
Leave
@Required
as-is, and just add the new@ RequiredColumn
annotation for the new case.Additional context
No response
The text was updated successfully, but these errors were encountered: