If there are objects in compound documents that have the same key and type, but the objects are not equal, the transformer would put the same resource identifier more than once into the included data. I didn't read about the "uniquness" of compund documents in the JSON API specification, but I suppose that such behaviour is not allowed.
I took the approach to merge objects with the same identifier, because I didn't got any better idea to handle this.
If there are objects in compound documents that have the same key and type, but the objects are not equal, the transformer would put the same resource identifier more than once into the included data. I didn't read about the "uniquness" of compund documents in the JSON API specification, but I suppose that such behaviour is not allowed.
I took the approach to merge objects with the same identifier, because I didn't got any better idea to handle this.