Bugzilla – Attachment 103751 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.38 KB, created by
Jonathan Druart
on 2020-04-27 11:00:11 UTC
(
hide
)
Description:
Bug 24908: Add text-formatted MARC support in /biblios/{biblio_id}
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-27 11:00:11 UTC
Size:
2.38 KB
patch
obsolete
>From 757447597d76cf3c6c94f9f9c53984cf04e87e98 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 > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 121d66fbe3..221d217522 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -82,13 +82,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 530993ff33..4896b71f62 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.20.1
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