SyliusResourceBundle icon indicating copy to clipboard operation
SyliusResourceBundle copied to clipboard

API Bundle: PUT should respond with 201 + create a resource if resource not found

Open dimaip opened this issue 4 years ago • 3 comments

Sylius version affected: 1.x.x

Description
Currently if you try to PUT some resource that doesn't yet exists, e.g. PUT /api/v1/products/notYetExistingProduct you'll get a 404 response and nothing will be created. I would expect 201 + creation of the new resource.

It's especially important when creating a sync script with some external catalog. Currently I have to do two requests per each product: first try to PUT, if 404 then POST.

Steps to reproduce
PUT /api/v1/products/notYetExistingProduct

dimaip avatar Jul 22 '19 14:07 dimaip