diff --git a/src/serializer.ts b/src/serializer.ts index 40afaba..afe4a33 100644 --- a/src/serializer.ts +++ b/src/serializer.ts @@ -100,6 +100,10 @@ function serializeEntity (entity, transformer: Transformer, options: Options, in delete data.relationships } + if (Object.keys(data.attributes).length === 0) { + delete data.attributes + } + return data }