You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that it's out of the specification, at least yet, but it's kind of common thing on the backend to create/update/delete more then one resource. I've found some approaches how do people do this in borders of json api in general, but I am just curious what is the best practise to do such a superstructure in a scope of this package. I am trying to rewrite controller methods in doc specified way, and which I believe is the only way here, but it feels bad, I need to break json api payload structure for this, and I dont feel where and how I can do it safely and clean. Otherwise, the only clean way to do it in the specification style is to send one request for one resource, but is it warranted to do it like that if I need to mass update 10 resources? 10 requests? Could you please provide some info about this, I don't want to build an ugly monster here.
The text was updated successfully, but these errors were encountered:
Hi! So the JSON:API spec has recently added an Atomic Operations extension, which would allow you to do bulk create/update/delete. Details are here: https://jsonapi.org/ext/atomic/
I do plan to support Atomic Operations, but I don't know when I'll get to them. This package is taking up a phenomenal amount of my time at the moment, and I really need to get back to real work sometime soon! But I will definitely get to Atomic Operations at some point as I want to use them in the APIs that I maintain - so I'm motivated!!
In the meantime, I tend to use Custom Actions for things that aren't defined in the spec. As these are custom things, I don't tend to use the JSON:API spec for the payload sent by the client, and instead just reply with a JSON:API payload. I.e. the request would be:
I know that it's out of the specification, at least yet, but it's kind of common thing on the backend to create/update/delete more then one resource. I've found some approaches how do people do this in borders of json api in general, but I am just curious what is the best practise to do such a superstructure in a scope of this package. I am trying to rewrite controller methods in doc specified way, and which I believe is the only way here, but it feels bad, I need to break json api payload structure for this, and I dont feel where and how I can do it safely and clean. Otherwise, the only clean way to do it in the specification style is to send one request for one resource, but is it warranted to do it like that if I need to mass update 10 resources? 10 requests? Could you please provide some info about this, I don't want to build an ugly monster here.
The text was updated successfully, but these errors were encountered: