I seem to only be able to create new entities when calling /merchant/1, however /merchant will return a 405 status.
This is my resource method for POSTs:
public function create($data)
{
return $this->mapper->create($data);
}
The id for this entity is an auto_incrment field so for me it makes sense for the client not to provide an identifier.
here's a snippet from my module.config.php:
'zf-rest' => array(
'MyTest\\V1\\Rest\\Merchant\\Controller' => array(
'listener' => 'MyTest\\V1\\Rest\\Merchant\\MerchantResource',
'route_name' => 'MyTest.rest.merchant',
'route_identifier_name' => 'merchant_id',
'collection_name' => 'merchant',
'entity_http_methods' => array(
0 => 'GET',
1 => 'PATCH',
2 => 'PUT',
3 => 'POST',
),
'collection_http_methods' => array(
0 => 'GET',
),
'collection_query_whitelist' => array(),
'page_size' => 25,
'page_size_param' => null,
'entity_class' => 'MyTest\\V1\\Rest\\Merchant\\MerchantEntity',
'collection_class' => 'MyTest\\V1\\Rest\\Merchant\\MerchantCollection',
'service_name' => 'Merchant',
),
Not sure what else I can provide to help you guys understand the situation but happy to provide more details on request.
Thanks for your time.