belgif / rest-problem-java

Java library for RFC 9457 Problems with support for standard problem types of the Belgif REST guide (https://www.belgif.be/specification/rest/api-guide/#error-handling)
https://belgif.github.io/rest-problem-java/
Apache License 2.0
3 stars 0 forks source link

Spin off validation logic to separate repository #106

Open pvdbosch opened 3 days ago

pvdbosch commented 3 days ago

As was mentioned in https://github.com/belgif/rest-guide/issues/169, there are some concerns of combining the validation logic of (business) values with the problem library.

I'd suggest to spin this off to a separate project because:

Some differences with the smalsutils-validation library:

Ideally, we could have a single validation logic for Java and integrate with different ways of using it (programmatic validation, bean validation, inside or outside a REST API context, ...)

jpraet commented 3 days ago

Where do you see InputValidationIssues.java fit in? In the problem library or in the validation library?

pvdbosch commented 3 days ago

Good point, I'd put at least the standardized business-agnostic issue types in rest-problem-java (like referencedResourceNotFound).

Not sure about the business-specific ones (like replacedSsin and canceledSsin). It's a bit the same discussion about whether they should be included in the REST guide. Maybe best in the validation library where they can evolve with the validations themselves. Then again, they might be reusable by other validation libraries as well, but that's probably a rather theoretical advantage.