Bug 32735

Summary: Add GET endpoint for listing Authorities
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: REST APIAssignee: Agustín Moyano <agustinmoyano>
Status: CLOSED FIXED QA Contact:
Severity: new feature    
Priority: P5 - low CC: david, jan.kissig, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
23.05.00
Circulation function:
Bug Depends on: 31796, 33080, 33083, 33329    
Bug Blocks: 31790    
Attachments: Bug 32735: Add endpoint to list authorities
Bug 32735: Add endpoint to list authorities
Bug 32735: Add endpoint to list authorities
Bug 32735: Add endpoint to list authorities
Bug 32735: Add endpoint to list authorities
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios
Bug 32735: Add endpoint to list authorities
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios

Description Nick Clemens (kidclamp) 2023-01-26 15:27:34 UTC
In addition to being able to GET a specific authority, we should be able to search and retrieve subsets of authorities
Comment 1 Agustín Moyano 2023-02-28 14:35:37 UTC
Created attachment 147492 [details] [review]
Bug 32735: Add endpoint to list authorities
Comment 2 Agustín Moyano 2023-02-28 14:42:08 UTC
Created attachment 147493 [details] [review]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off
Comment 3 David Nind 2023-04-08 20:32:02 UTC
The patch no longer applies 8-(..

git bz apply 32735

Bug 32735 - REST API: Add a list endpoint for Authorities

147493 - Bug 32735: Add endpoint to list authorities

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 32735: Add endpoint to list authorities
error: sha1 information is lacking or useless (Koha/REST/V1/Authorities.pm).
error: could not build fake ancestor
Patch failed at 0001 Bug 32735: Add endpoint to list authorities
Comment 4 Agustín Moyano 2023-04-14 18:39:51 UTC
Created attachment 149703 [details] [review]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off
Comment 5 David Nind 2023-04-14 19:03:02 UTC
Created attachment 149705 [details] [review]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-04-14 19:04:20 UTC
Testing notes (using KTD):

1. Used Postman to send requests.

2. 20 results are returned for each of the different Accept headers.

3. The tests pass.
Comment 7 Tomás Cohen Arazi (tcohen) 2023-04-14 20:31:56 UTC
We might need a follow-up for UNIMARC authorities as of bug 33329.
Comment 8 Agustín Moyano 2023-05-03 18:35:20 UTC
Created attachment 150615 [details] [review]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Agustín Moyano 2023-05-03 18:35:23 UTC
Created attachment 150616 [details] [review]
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios
Comment 10 Nick Clemens (kidclamp) 2023-05-05 12:32:40 UTC
Created attachment 150746 [details] [review]
Bug 32735: Add endpoint to list authorities

This patch adds an endpoint to list authorities

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/authorities with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/api/v1/authorities.t
6. sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Nick Clemens (kidclamp) 2023-05-05 12:32:43 UTC
Created attachment 150747 [details] [review]
Bug 32735: (follow-up) Make Koha::Objects::Record::Collections->print_collection work with Authorities and Biblios

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Tomás Cohen Arazi (tcohen) 2023-05-05 15:14:43 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 13 Martin Renvoize (ashimema) 2023-05-12 15:00:19 UTC
As the dependency states.. if we want this for 22.11 let me know and we can backport as a full set.  Otherwise, not backporting for now.