Bugzilla – Attachment 101029 Details for
Bug 24908
Allow fetching text-formatted MARC data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id}
Bug-24908-Add-text-formatted-MARC-support-in-bibli.patch (text/plain), 2.26 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-03-19 15:09:03 UTC
(
hide
)
Description:
Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id}
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-03-19 15:09:03 UTC
Size:
2.26 KB
patch
obsolete
>From d295272360a3e903f21e6a0d11c08e7f762f45ad Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 19 Mar 2020 12:04:39 -0300 >Subject: [PATCH] Bug 24908: Add text-formatted MARC support in > /biblios/{biblio_id} > >This patch makes the route support requesting (through the Accept >header) the MARC record to be output as formatted text as in >$record->as_formatted. > >To test: >1. Apply the unit tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/biblios.t >=> FAIL: Tests fail >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Try the route with your favourite API testing tool (Postman?) >=> SUCCESS: Accept: text/plain returns the expected results >=> SUCCESS: Wrong Accept header returns a list of valid formats, and >includes 'text/plain'. >6. Sign off :-D >--- > Koha/REST/V1/Biblios.pm | 8 +++++++- > api/v1/swagger/paths/biblios.json | 3 ++- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index af13f283bd..07af3b1f18 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -81,13 +81,19 @@ sub get { > format => 'marc', > text => $record->as_usmarc > }, >+ txt => { >+ status => 200, >+ format => 'text/plain', >+ text => $record->as_formatted >+ }, > any => { > status => 406, > openapi => [ > "application/json", > "application/marcxml+xml", > "application/marc-in-json", >- "application/marc" >+ "application/marc", >+ "text/plain" > ] > } > ); >diff --git a/api/v1/swagger/paths/biblios.json b/api/v1/swagger/paths/biblios.json >index b2bb58a6ce..27ccc4c3e1 100644 >--- a/api/v1/swagger/paths/biblios.json >+++ b/api/v1/swagger/paths/biblios.json >@@ -15,7 +15,8 @@ > "application/json", > "application/marcxml+xml", > "application/marc-in-json", >- "application/marc" >+ "application/marc", >+ "text/plain" > ], > "responses": { > "200": { >-- >2.25.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24908
:
101028
|
101029
|
102158
|
102159
|
103750
|
103751