Not sure if this is a stupid question or not, maybe I'm missing something. When customizing methods on $resource
I can use isArray
to specify if the resource is an array or not. The problem is that isArray
is used, for example with POST
, to check both the shape of the request body and of the response. This means that I cannot have, for example, a POST
where I need an array of anything (i.e. a set of operations to add to a batch task) in my request and I send a single object as a response (the batch task itself).
This is not a coding problem, I can work around this, it's more a design question: why do response and request have to have the same shape? I do not think that's stated anywhere around how to build REST services, they might usually have the same shape but they do not have to. What am I missing?