We are in a weird situation where we have a relied-upon endpoint that both embeds data and sideloads it. I have no idea why it was built this way, and why no one thought hey, we seem to be sending all of this data twice
, but to divine the reasons of the former stewards of our code is a sisyphean task.
I'm rewriting the currently-manually-built JSON output to use serializers, because deleting useless code is joyful. However, I can't seem to figure out two issues:
1) There does not seem to be a way to embed an object and also sideload it. I know I can sideload by setting embed :ids, include: true
, but this only returns the ids
of the sideloaded objects from within the parent relation.
2) Is there a way to not set the embeds
status for every relation? It seems that the only way to set something sideloaded or embedded is that embed :ids...
line, but that affects everything that is a relation. How do I get more granular control over embedding/sideloading?