Search code examples
jsonspringember.jsember-datajson-api

In need to either convert Spring's default HAL format to JSON API, or make Ember Data accept HAL json format


My Ember.js front-end application is to consume REST API created in Spring (Boot). The problem is: - Spring returns json response in HAL format - Ember Data expect the response to be fully compliant with JSON API specs

So far I have found that there are at least two "adapters" for each side.

This one is supposed to convince Ember Data to use the Spring's response as it is: ember-data-hal-9000

This one makes Spring's response compliant with JSON API specs: Katharsis - HATEOAS for Java based on JSON API standard

I've read that both have its own problems but has anyone successfully employed either of them? Ideally both of them, so a comparison can be made?


Solution

  • I worked for a client for a while who had gone with Katharsis. The backend developers disliked Katharsis (as it had made some non-spec compliant "decisions" that had to be worked around), but part of that may also have been due to a fairly messy backend data model.

    It worked great on the Ember side of things 😉