From abb1a52b7e9229e13fac43b25743d7632f22a5d1 Mon Sep 17 00:00:00 2001 From: Polo M2B Date: Mon, 16 Oct 2023 12:39:51 +0200 Subject: [PATCH] Demo: Adapt delete routes With this commit: Review can be deleted (operation added) Boon can not be deleted (operation removed, this is a breaking change) --- api/src/Entity/Book.php | 2 -- api/src/Entity/Review.php | 2 ++ docs/openapi.json | 66 +++++++++++++++++++-------------------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/api/src/Entity/Book.php b/api/src/Entity/Book.php index 5f359e8..1b006f0 100644 --- a/api/src/Entity/Book.php +++ b/api/src/Entity/Book.php @@ -4,7 +4,6 @@ use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Put; -use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Post; use Doctrine\Common\Collections\ArrayCollection; @@ -15,7 +14,6 @@ operations: [ new Get(), new Put(), - new Delete(), new GetCollection(), new Post(), ] diff --git a/api/src/Entity/Review.php b/api/src/Entity/Review.php index c645421..b93c4ed 100644 --- a/api/src/Entity/Review.php +++ b/api/src/Entity/Review.php @@ -4,6 +4,7 @@ use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\Put; +use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Post; use ApiPlatform\Metadata\Patch; @@ -14,6 +15,7 @@ operations: [ new Get(), new Put(), + new Delete(), new GetCollection(), new Post(), new Patch(), diff --git a/docs/openapi.json b/docs/openapi.json index 10295db..757d031 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -344,39 +344,6 @@ }, "deprecated": false }, - "delete": { - "operationId": "api_books_id_delete", - "tags": [ - "Book" - ], - "responses": { - "204": { - "description": "Book resource deleted" - }, - "404": { - "description": "Resource not found" - } - }, - "summary": "Removes the Book resource.", - "description": "Removes the Book resource.", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Book identifier", - "required": true, - "deprecated": false, - "allowEmptyValue": false, - "schema": { - "type": "string" - }, - "style": "simple", - "explode": false, - "allowReserved": false - } - ], - "deprecated": false - }, "parameters": [] }, "/reviews": { @@ -711,6 +678,39 @@ }, "deprecated": false }, + "delete": { + "operationId": "api_reviews_id_delete", + "tags": [ + "Review" + ], + "responses": { + "204": { + "description": "Review resource deleted" + }, + "404": { + "description": "Resource not found" + } + }, + "summary": "Removes the Review resource.", + "description": "Removes the Review resource.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Review identifier", + "required": true, + "deprecated": false, + "allowEmptyValue": false, + "schema": { + "type": "string" + }, + "style": "simple", + "explode": false, + "allowReserved": false + } + ], + "deprecated": false + }, "patch": { "operationId": "api_reviews_id_patch", "tags": [