Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading