So, I have a create method on Apigility to create a resoure which is basically a
POST /resources
{
<fields go here>
}
... and I was wondering how can I also have the option to create a list of these resources.
From what I can see these are my options:
PUT /resources
PATCH /resources
but I'm not sure which kind of payload I should send. Should I send an array of resources or an object with an array of resources?
If you create a DbConnected Service, see this code https://github.com/zfcampus/zf-apigility/blob/master/src/DbConnectedResource.php.
This methods are not implemented by default.
If you create a code connected service, you can send any payload. The data will be parsed as a array to you make what you want.
I don't know the behavior of validation on these requests.
If you send a array of entities, the Apigility 1.0.4 will validate each entity (see this link), maybe you have to write especific validators to each HTTP METHOD, or relax the general validator (see this link).
This link has some suggest to your payload https://apigility.org/documentation/api-primer/halprimer.
In your case I would use a array.