SyliusResourceBundle
SyliusResourceBundle copied to clipboard
API Bundle: PUT should respond with 201 + create a resource if resource not found
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