From 819964108f0fd0971a1c663b5916ceda262a0163 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Mon, 21 Sep 2026 14:34:34 +0200 Subject: [PATCH] feat!: throw exception when an operation is not delared in ApiResource for parameter attributes on properties --- core/filters.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/filters.md b/core/filters.md index fbf442ee2c9..4306ae9771b 100644 --- a/core/filters.md +++ b/core/filters.md @@ -341,7 +341,7 @@ class Book #[QueryParameter(key: 'name', filter: new PartialSearchFilter(), operations: [new GetCollection()])] public string $name = ''; - // Applies only to GetCollection (Patch is not in the list of operations) + // Error: Patch is not declared in the resource operations #[HeaderParameter(key: 'X-Authorization', operations: [new GetCollection(), new Patch()])] public string $authToken = ''; } @@ -354,6 +354,9 @@ The restriction matches on the operation class, not on a single configured opera declares two `Get` operations with different URI templates, `operations: [new Get()]` applies the parameter to both of them. +Every operation listed in `operations` must be declared in the resource operations, otherwise an +error is thrown. + ### Filtering a Single Property Most of the time, a parameter maps directly to a property on your resource. For example, a