Reputation: 1693
When creating an entity with @ApiResource
, you get 5 routes:
GET /api/entities
POST /api/entities
GET /api/entities/{id}
DELETE /api/entities/{id}
PUT /api/entities/{id}
How can I disable the first route ?
Thanks.
Upvotes: 0
Views: 281
Reputation: 98
You should customize the collectionOperations
attribute in your @ApiResource
annotation
/**
* @ApiResource(
* collectionOperations={}
* )
*/
For more information: https://api-platform.com/docs/core/operations/#enabling-and-disabling-operations
Upvotes: 1