Koha-clms/Koha/REST
Tomas Cohen Arazi 2550b3b608 Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI
Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.

Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.

As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
validation on objects.search, for the non-arrayref use case and does the
right thing.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2022-03-25 10:41:01 -04:00
..
Plugin Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI 2022-03-25 10:41:01 -04:00
V1 Bug 30165: (follow-up) Fix GET /acquisitions/orders 2022-03-25 09:37:06 -04:00
V1.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00