From d15cc34cb986c3292e5264701670e8728e8e912a Mon Sep 17 00:00:00 2001 From: Hongwei Date: Tue, 10 Nov 2026 12:10:03 +0100 Subject: [PATCH 1/2] test: pin that a misspelt v7.0.0 customers parameter filters by an attribute of that name --- .../code/api/v7_0_0/CustomersAtOneBankV700Test.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/obp-api/src/test/scala/code/api/v7_0_0/CustomersAtOneBankV700Test.scala b/obp-api/src/test/scala/code/api/v7_0_0/CustomersAtOneBankV700Test.scala index 98527c51ce..6e79df564f 100644 --- a/obp-api/src/test/scala/code/api/v7_0_0/CustomersAtOneBankV700Test.scala +++ b/obp-api/src/test/scala/code/api/v7_0_0/CustomersAtOneBankV700Test.scala @@ -114,6 +114,15 @@ class CustomersAtOneBankV700Test extends V600ServerSetup { "sort_by" -> "name", "obp_limit" -> "10", "_" -> "123") should equal(List(matching)) } + scenario("A misspelt parameter name is taken for an attribute name, so it matches no Customer instead of failing", CustomersAtOneBank, VersionOfApi) { + val tag = generateUUID().take(6) + val matching = customer("organisation_kind" -> s"bank-$tag") + ids("organisation_kind" -> s"bank-$tag") should equal(List(matching)) + // limt is not limit: it is a filter on an attribute named limt, which no Customer has. + ids("organisation_kind" -> s"bank-$tag", "limt" -> "10") should equal(Nil) + ids("limt" -> "10") should equal(Nil) + } + scenario("sort_direction orders the matching Customers by customer_id, DESC by default, and pages follow that order", CustomersAtOneBank, VersionOfApi) { val tag = generateUUID().take(6) val created = (1 to 3).map(_ => customer("cohort" -> s"s-$tag")).toList.sorted From 8a61c2ac23524003a41fd68f568632e250695340 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Tue, 10 Nov 2026 12:10:03 +0100 Subject: [PATCH 2/2] docs: say in Get Customers at Bank that a misspelt parameter name is an attribute filter --- .../src/main/scala/code/api/v7_0_0/Http4s700Customers.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/obp-api/src/main/scala/code/api/v7_0_0/Http4s700Customers.scala b/obp-api/src/main/scala/code/api/v7_0_0/Http4s700Customers.scala index 7577c9ea2f..8a995665e6 100644 --- a/obp-api/src/main/scala/code/api/v7_0_0/Http4s700Customers.scala +++ b/obp-api/src/main/scala/code/api/v7_0_0/Http4s700Customers.scala @@ -153,6 +153,11 @@ object Http4s700Customers { |sort_by, and names starting with obp_ or _. Apart from limit, offset and sort_direction (lower case) |they are accepted and ignored, as in v6.0.0. | + |Every other query parameter is an attribute filter, so a misspelt name is not refused: it filters by an + |attribute of that name. For example, `?limt=10` asks for the Customers with an attribute `limt` whose + |value is `10`. That usually matches no Customer, and the answer is an empty list, not an error. Check + |the spelling of limit, offset and sort_direction when a call returns no Customers. + | |A single value of a parameter whose name ends in currency or currency_code that looks like a currency |code is upper-cased by OBP-API before it is matched, as on every endpoint; comma-separated values are |matched as given.