Skip to content

UftpValidator to give context specific rejection reasons #166

@tomwetjens

Description

@tomwetjens

Currently UftpValidator only supports 1 rejection reason (through getReason) which cannot be made context specific to the validated message.

Case 1

E.g. a user defined validator that checks the ExpirationDateTime must be before Period-12H.

Currently the reason would always be: "ExpirationDateTime must at least 12H before Period"

Desired reason: "ExpirationDateTime must be before YYYY-MM-DDTHH:mm:ss"

Case 2

E.g. a user defined validator that combines 2 checks and wants to give a specific reason for each of the cases. Currently this would require two separate validator classes that each must have the correct order.

Proposal:

Let isValid return a ValidationResult including the reason instead of a boolean. Remove getReason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions