jsonapi-serializer
jsonapi-serializer copied to clipboard
Relationships with classes
I'm using classes for my models. Which means that the function lodash.isPlainObject returns false. Even if it should serialize the relationship.
I changed this https://github.com/SeyZ/jsonapi-serializer/blob/2c3b80fb7e6f95cf6fd25f6750de372c77f24558/lib/serializer-utils.js#L19
to return Array.isArray(obj) || isObjectLike(obj); which yields the correct results for me.
To make sure it keeps working I copied existing tests using plain object to use classes instead. They where failing before my fix and now work.
I would like to ask if there is any chance this will be merged and released. Due to this bug I have to deploy from local (with edited serializer-utils) instead of using CI/CD. Thanks
Hey, we need this also on https://github.com/1024pix/pix. This is possible to merge ? If you need help you could add me to maintainer. I could review PR and merge.