Bug 39817 - All list endpoints should have the x-koha-request-id parameter definition
Summary: All list endpoints should have the x-koha-request-id parameter definition
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-02 13:18 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2025-05-02 14:16 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39817: Add some GET routes tests (4.72 KB, patch)
2025-05-02 14:16 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2025-05-02 13:18:02 UTC
This is mandatory for using them with our `kohaTable` datatables wrapper.

I spotted the `/acquisitions/baskets` endpoint doesn't have it. We should have a test for it.
Comment 1 Tomás Cohen Arazi (tcohen) 2025-05-02 14:16:16 UTC
Created attachment 181869 [details] [review]
Bug 39817: Add some GET routes tests

This patch adds tests for to-be mandatory parameters for plural
endpoints:

* match
* order_by
* page
* per_page
* q_param
* q_body
* request_id_header

Exceptions should be added if found in the wild, but the tests are
needed.

Another check it adds is GET requests `operationId` should start with:

* list
* get

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/api.t
=> FAIL: Tests pass! But our spec is bad
2. Apply this patch
3. Repeat 1
=> SUCCESS: All mistakes make the tests fail!
4. Sign off :-D

Note: a follow-up patch/set of patches should make this tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>