scoutforpets / jsonapi-mapper

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

Virtual properties are not mapped #35

Closed kwelch2015 closed 7 years ago

kwelch2015 commented 8 years ago

When sending in a bookshelf model to map where there are virtual properties added (using the Virtuals plugin) the mapper ignores them. I have a fix for util.ts that will check for the presence of virtual properties and when the virtual properties are marked visible they will get added to the attributes that will be part of the JSONAPI payload returned.

jamesdixon commented 8 years ago

Thanks for reporting this. I'm not using any virtual properties currently, so completely missed this. Would you mind submitting a PR?

Cheers!

jamesdixon commented 8 years ago

@kwelch2015 you mentioned that you have a fix for this: would you mind submitting a PR?

jamesdixon commented 8 years ago

@chamini2 would be good to fix this and #76 given that they're both core bookshelf plugins