Skip to content

When validation fails you should have the option to not perform binding #55

@hambone01

Description

@hambone01

There seems to be no way to detect a validation failure and therefor not bind. Take justify-examples-binding as the example. When the json is invalid the Person object should not be created. Maybe fromJson should return an Optional?

If the json is invalid, yet the object is still created, then how is user to know? Maybe if you don't provide a ProblemHandler then justify defaults to returning an empty Optional?

I realize I can add functionality to my ProblemHandler Object but that isn't exactly convenient. I would think the normal use-case would be validating incoming requests so that bad ones are disguarded or possibly fixed, but in that order.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions