Bug 31800 - Add POST endpoint for Biblios
Summary: Add POST endpoint for Biblios
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature
Assignee: Agustín Moyano
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
: 28201 (view as bug list)
Depends on:
Blocks: 33251 31788 31801 33227
  Show dependency treegraph
 
Reported: 2022-10-14 14:41 UTC by Nick Clemens (kidclamp)
Modified: 2024-07-04 20:37 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04
Circulation function:


Attachments
Bug 31800: Add REST endpoint to add a biblio (22.51 KB, patch)
2022-12-23 20:33 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 31800: Add REST endpoint to add a biblio (18.01 KB, patch)
2022-12-26 13:25 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 31800: Add REST endpoint to add a biblio (18.50 KB, patch)
2022-12-26 15:03 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 31800: Add REST endpoint to add a biblio (18.54 KB, patch)
2023-01-20 12:54 UTC, Jan Kissig
Details | Diff | Splinter Review
Bug 31800: Add REST endpoint to add a biblio (18.59 KB, patch)
2023-03-03 16:27 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-10-14 14:41:06 UTC

    
Comment 1 Agustín Moyano 2022-12-23 20:33:00 UTC
Created attachment 144830 [details] [review]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. If content type is other than application/json, then add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off
Comment 2 Agustín Moyano 2022-12-26 13:25:25 UTC
Created attachment 144835 [details] [review]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. Add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off
Comment 3 Agustín Moyano 2022-12-26 15:03:13 UTC
Created attachment 144837 [details] [review]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. Add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off
Comment 4 Jan Kissig 2023-01-20 12:54:37 UTC
Created attachment 145509 [details] [review]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. Add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off

Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Comment 5 David Nind 2023-01-30 10:35:40 UTC
Changed status to signed off - signed off by Jan Kissig on 2023-01-20.
Comment 6 Kyle M Hall (khall) 2023-03-03 16:27:03 UTC
Created attachment 147714 [details] [review]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. Add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off

Signed-off-by: Jan Kissig <jkissig@th-wildau.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Tomás Cohen Arazi (tcohen) 2023-03-10 14:47:51 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 8 Pedro Amorim 2023-03-14 14:35:49 UTC
swagger-cli validate swagger.yaml:

Validation failed. /paths/biblios/post/parameters/Body has an invalid type (string,object)
Comment 9 Tomás Cohen Arazi (tcohen) 2023-03-14 15:15:14 UTC
(In reply to Pedro Amorim from comment #8)
> swagger-cli validate swagger.yaml:
> 
> Validation failed. /paths/biblios/post/parameters/Body has an invalid type
> (string,object)

Can you file a separate bug for this? It is time to add the validation to the test suite.
Comment 10 Jacob O'Mara 2023-03-16 19:48:59 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 11 Martin Renvoize (ashimema) 2023-03-20 17:13:33 UTC
The backport here causes test failures, (git auto-merged more than expected into the spec).

I also feel like we need to get the whole tree working as a set before we consider a possible backport of this.. whilst it's API and thus Dev facing only really and might make sense to backport at a future point.. I think we need to focus on stability in this area first.

Reverting for now.
Comment 12 Martin Renvoize (ashimema) 2023-03-20 17:19:38 UTC
OK.. Ignore that.. Whilst I still think it was a mistake to backport at this stage.. it's also a challenge to revert now too...  we'll be most stable by keeping it
Comment 13 Julian Maurice 2023-03-23 07:16:13 UTC
*** Bug 28201 has been marked as a duplicate of this bug. ***