Skip to content

Clarify @Required annotations for validation #1343

@briandonahue

Description

@briandonahue

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 empty

Alternatives you've considered

Leave @Required as-is, and just add the new @ RequiredColumn annotation for the new case.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature request or improvement on an existing featurestatus: Needs discussionWe need a discussion on requirements before calling this issue ready

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions