Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo: Adapt delete routes #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/src/Entity/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,7 +14,6 @@
operations: [
new Get(),
new Put(),
new Delete(),
new GetCollection(),
new Post(),
]
Expand Down
2 changes: 2 additions & 0 deletions api/src/Entity/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,6 +15,7 @@
operations: [
new Get(),
new Put(),
new Delete(),
new GetCollection(),
new Post(),
new Patch(),
Expand Down
66 changes: 33 additions & 33 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": [
Expand Down