From 49af4cd9aa4eabdb618c83e2cfa2aa759c738e6c Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 26 Sep 2019 09:08:52 +0200 Subject: [PATCH 1/4] Document disabling item operation --- core/operations.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/core/operations.md b/core/operations.md index 393245f44ac..20c3a25eb86 100644 --- a/core/operations.md +++ b/core/operations.md @@ -134,6 +134,31 @@ Or the XML configuration format: API Platform Core is smart enough to automatically register the applicable Symfony route referencing a built-in CRUD action just by specifying the method name as key, or by checking the explicitly configured HTTP method. +If you want to completely remove item operations, you have to declare a default GET operation so that the resource can still be identified by an IRI. For example: + +``` + Date: Sat, 28 Sep 2019 11:32:41 +0200 Subject: [PATCH 2/4] Update core/operations.md Co-Authored-By: Teoh Han Hui --- core/operations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/operations.md b/core/operations.md index 20c3a25eb86..5fc32abcfff 100644 --- a/core/operations.md +++ b/core/operations.md @@ -134,7 +134,7 @@ Or the XML configuration format: API Platform Core is smart enough to automatically register the applicable Symfony route referencing a built-in CRUD action just by specifying the method name as key, or by checking the explicitly configured HTTP method. -If you want to completely remove item operations, you have to declare a default GET operation so that the resource can still be identified by an IRI. For example: +If you do not want to allow access to the resource item (i.e. you don't want a `GET` item operation), instead of omitting it altogether, you should instead declare a `GET` item operation which returns HTTP 404 (Not Found), so that the resource item can still be identified by an IRI. For example: ``` Date: Sat, 28 Sep 2019 11:32:48 +0200 Subject: [PATCH 3/4] Update core/operations.md Co-Authored-By: Teoh Han Hui --- core/operations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/operations.md b/core/operations.md index 5fc32abcfff..3cc72c8aada 100644 --- a/core/operations.md +++ b/core/operations.md @@ -156,7 +156,9 @@ use ApiPlatform\Core\Annotation\ApiResource; * }, * ) */ - class Book {} + class Book + { + } ``` ## Configuring Operations From 3f13fa0704b63f0c1f5e79b5a007abe25358bf31 Mon Sep 17 00:00:00 2001 From: soyuka Date: Sat, 28 Sep 2019 11:31:29 +0200 Subject: [PATCH 4/4] add namespaces --- core/operations.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/operations.md b/core/operations.md index 3cc72c8aada..c57d1a646bb 100644 --- a/core/operations.md +++ b/core/operations.md @@ -63,6 +63,8 @@ will be automatically added.