toedter / spring-hateoas-jsonapi

A JSON:API media type implementation for Spring HATEOAS
Apache License 2.0
106 stars 15 forks source link

No support for spring-web HttpMessageConverter #55

Closed NorbertHoene closed 2 years ago

NorbertHoene commented 2 years ago

Hello,

It seems this library does not support spring-web RestTemplate.

The only thing what would be needed to support spring-web RestTemplate should be an implemenation of class HttpMessageConverter.java (https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/converter/HttpMessageConverter.html)

Would it be possible to add such a HttpMessageConverter

toedter commented 2 years ago

Thx for reporting this. I'll take a look at it.

toedter commented 2 years ago

I think I found a good solution to use RestTemplate with this library, see https://toedter.github.io/spring-hateoas-jsonapi/snapshot/reference/#resttemplate. You find integration tests using RestTemplate and this approach here: https://github.com/toedter/spring-hateoas-jsonapi/blob/e4bf761413814d070f0f3fd9b14e522b3830df18/lib/src/test/java/com/toedter/spring/hateoas/jsonapi/RestTemplateIntegrationTest.java#L82-L96

If it is not good enough, please re-open this issue.