Skip to content

Conversation

@shilps1583
Copy link

Fixes issue #203

@martinezguillaume
Copy link

Here is my jsonapi-serializer+3.6.9.patch to solve this

diff --git a/node_modules/jsonapi-serializer/lib/deserializer.js b/node_modules/jsonapi-serializer/lib/deserializer.js
index 1cb7c1a..d8fc6e4 100644
--- a/node_modules/jsonapi-serializer/lib/deserializer.js
+++ b/node_modules/jsonapi-serializer/lib/deserializer.js
@@ -31,8 +31,9 @@ module.exports = function (opts) {
           return result
         });
     }
-
-    if (Array.isArray(jsonapi.data)) {
+    if (!jsonapi.data) {
+      return jsonapi.data
+    } else if (Array.isArray(jsonapi.data)) {
       return collection();
     } else {
       return resource();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants