scoutforpets / jsonapi-mapper

JSON API-Compliant Serialization for your Node ORM
The Unlicense
42 stars 24 forks source link

issues with mapperOptions vs serializerOptions #62

Closed jamesdixon closed 8 years ago

jamesdixon commented 8 years ago

It seems there are some issues when passing in serializerOptions. I believe this is in part because the actual JSONAPISerializer docs are a bit confusing. For example, if you'd like to return only the ids of your model's relationships, you must pass included: false to the serializer. However, this only works when included in the relationship options and not on a global level. As mentioned earlier, this isn't well documented; I only figured it out first through trial and error and then finally looking at the tests.

Unfortunately, I was unable to get this property passed in properly to the relationship and therefore couldn't get this working with the mapper.

Point is, I think we need to clear up our documentation, submit a PR for the serializer documentation and make any changes to allow serializer options to be passed through properly.

This probably also relates to the discussion regarding #59.

jamesdixon commented 8 years ago

I'm going to close this and open separate, more specific issues.