belgif / rest-guide

REST Guidelines of Belgian government institutions
https://www.belgif.be/specification/rest/api-guide/
Apache License 2.0
24 stars 4 forks source link

Java library for working with RFC 9457 Problems #169

Closed pvdbosch closed 4 months ago

pvdbosch commented 7 months ago

Goal is to create an open-source library to work with RFC 9457 Problems that are compliant with the Belgif REST guide.

It could be based on CBSS' rest-problem library.

It was presented on WG of 2024-01-24:

Feedback:

pvdbosch commented 7 months ago

next steps:

pvdbosch commented 7 months ago

first feedback from within Smals is same as mentioned on WG (incl to separate validation logic from the problem lib) and positive about this initiative

jpraet commented 6 months ago

For the Spring Boot users:

For the Java EE users:

General question:

At CBSS, besides the configuration for the polymorhpic deserialization of the Problem types, we also apply following configuration to Jackson ObjectMapper:

These are not really related to the problem library per se, but more for general compliance with the Belgif REST Guidelines. I'm not sure whether those customizations should be included in the problem library?

pvdbosch commented 6 months ago

For the Spring Boot users:

  • do you use @RestController and RestTemplate? (those are currently supported by the problem library)

yes

  • anyone using the org.springframework.web.reactive.client.WebClient? (currently not yet supported)

no

  • anyone using the Spring Boot 3.2 RestClient already? (currently not yet supported)

no

  • do you use Bean Validation in Spring Boot apps? (currently not yet supported as I extracted that to the *-java-ee module)

yes

For the Java EE users:

  • do you use MicroProfile REST Client? (this is currently supported by the problem library) no (isn't activated yet in base image)

  • do you use the JAX-RS 2.0 Client API? I did not manage to get it working to get this to transparently throw a Problem exception.

yes, generated by our own variant of the jaxrs-spec language of openapi-generator

General question:

we also apply following configuration to Jackson ObjectMapper: ... These are not really related to the problem library per se, but more for general compliance with the Belgif REST Guidelines. I'm not sure whether those customizations should be included in the problem library?

I don't think so, Smals has similarly a rest-jackson library with a variant of these customizations that does "mapper.findAndRegisterModules()"

jpraet commented 6 months ago

For the groupId and top-level java package: "io.github.belgif.problem"? And for the repo name: "belgif-problem"? or just "problem"?

pvdbosch commented 6 months ago

suggestions: groupId: io.github.belgif.rest.problem artifactId: belgif-rest-problem

GitHub repo name: rest-problem-java

Rationale:

pvdbosch commented 5 months ago

CBSS has worked on this lib:

I'll create a "rest-problem-java" github repo under belgif.

jpraet commented 4 months ago

Github repo: https://github.com/belgif/rest-problem-java Documentation: https://belgif.github.io/rest-problem-java/latest/ Javadoc: https://belgif.github.io/rest-problem-java/latest/apidocs/ Maven Central: https://central.sonatype.com/namespace/io.github.belgif.rest.problem

Initial pre-release version 0.1.0 is available. Feedback is welcome.