Bug 34054 - Allow to embed biblio on GET /items
Summary: Allow to embed biblio on GET /items
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 30708
  Show dependency treegraph
 
Reported: 2023-06-19 07:48 UTC by Jonathan Druart
Modified: 2023-10-17 11:21 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.11


Attachments
Bug 34054: Add tests (1.14 KB, patch)
2023-06-19 07:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34054: Allow to embed biblio on GET /items (1.05 KB, patch)
2023-06-19 07:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34054: Add tests (1.19 KB, patch)
2023-07-23 09:10 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 34054: Allow to embed biblio on GET /items (1.10 KB, patch)
2023-07-23 09:10 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 34054: Add tests (1.29 KB, patch)
2023-09-22 12:07 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 34054: Allow to embed biblio on GET /items (1.20 KB, patch)
2023-09-22 12:07 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-06-19 07:48:44 UTC

    
Comment 1 Jonathan Druart 2023-06-19 07:52:29 UTC
Created attachment 152466 [details] [review]
Bug 34054: Add tests

Sponsored-by: BULAC - http://www.bulac.fr/
Comment 2 Jonathan Druart 2023-06-19 07:52:32 UTC
Created attachment 152467 [details] [review]
Bug 34054: Allow to embed biblio on GET /items

Test plan:
Request the /items REST API endpoint and ask for the biblio's info to be
embeded into the response passing x-koha-embed

curl -u koha:koha --request GET 'http://localhost:8081/api/v1/items' --header "x-koha-embed: biblio" --header "Content-Type: application/json"

Sponsored-by: BULAC - http://www.bulac.fr/
Comment 3 Andreas Roussos 2023-07-23 09:10:04 UTC
Notes from testing:

All works as expected, I ran the curl command provided in the test plan
and observed that biblio data was indeed embedded in the JSON response.

The updated unit test passes, too:

$ prove t/db_dependent/api/v1/items.t
t/db_dependent/api/v1/items.t .. ok
All tests successful.
Files=1, Tests=5, 10 wallclock secs ( 0.05 usr  0.02 sys +  9.34 cusr  0.88 csys = 10.29 CPU)
Result: PASS
Comment 4 Andreas Roussos 2023-07-23 09:10:39 UTC
Created attachment 153819 [details] [review]
Bug 34054: Add tests

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Comment 5 Andreas Roussos 2023-07-23 09:10:41 UTC
Created attachment 153820 [details] [review]
Bug 34054: Allow to embed biblio on GET /items

Test plan:
Request the /items REST API endpoint and ask for the biblio's info to be
embeded into the response passing x-koha-embed

curl -u koha:koha --request GET 'http://localhost:8081/api/v1/items' --header "x-koha-embed: biblio" --header "Content-Type: application/json"

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Comment 6 Marcel de Rooy 2023-09-22 09:45:51 UTC
    #   Failed test 'SWAGGER3.2.2'
    #   at /usr/share/koha/t/db_dependent/api/v1/items.t line 83.
    #          got: '500'
    #     expected: '200'
     # Looks like you planned 15 tests but ran 5.
    # Looks like you failed 1 test of 5 run.
Comment 7 Jonathan Druart 2023-09-22 09:47:34 UTC
(In reply to Marcel de Rooy from comment #6)
>     #   Failed test 'SWAGGER3.2.2'
>     #   at /usr/share/koha/t/db_dependent/api/v1/items.t line 83.
>     #          got: '500'
>     #     expected: '200'
>      # Looks like you planned 15 tests but ran 5.
>     # Looks like you failed 1 test of 5 run.

This is passing for me :-/
Comment 8 Marcel de Rooy 2023-09-22 10:08:08 UTC
Test failure resolved. Will resume QA later today
Comment 9 Marcel de Rooy 2023-09-22 12:07:32 UTC
Created attachment 156078 [details] [review]
Bug 34054: Add tests

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2023-09-22 12:07:34 UTC
Created attachment 156079 [details] [review]
Bug 34054: Allow to embed biblio on GET /items

Test plan:
Request the /items REST API endpoint and ask for the biblio's info to be
embeded into the response passing x-koha-embed

curl -u koha:koha --request GET 'http://localhost:8081/api/v1/items' --header "x-koha-embed: biblio" --header "Content-Type: application/json"

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 11 Tomás Cohen Arazi 2023-09-22 14:34:44 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-09-22 19:44:26 UTC
Small API enhancement, I choose to backport to 23.05

Pushed to 23.05.x for 23.05.04
Comment 13 Jacob O'Mara 2023-10-17 11:21:09 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x