GSON compatible with Ember?


#1

Hello everyone!

Is this Google GSON compatible with Ember?


#2

I think you may be confusing exactly what GSON (or Ember) is. Ember is a Javascript library that runs in the client’s browser; GSON is a Java library that runs on your server. The two don’t really have anything to do with each other except for the fact that they both ‘speak’ JSON. So, in that sense, yes, they’re ‘compatible’.


#3

Gordon,

Actually I completely understood the difference, what I was asking was: is the JSON put out by this Google library compatible with the Ember Data Rest Adapters.

The Ember adapters expect JSON to have a particular format as referenced here: http://jsonapi.org/format/


#4

GSON just serializes Java objects to JSON. If you want the JSON in a particular format, like the JSON API format, you have to do that yourself. You can use GSON to do that, but it doesn’t do it out of the box.