Bugzilla – Attachment 148626 Details for
Bug 33328
x-marc-schema should be renamed x-record-schema
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33328: Rename x-marc-schema => x-record-schema
Bug-33328-Rename-x-marc-schema--x-record-schema.patch (text/plain), 2.83 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-03-23 22:53:22 UTC
(
hide
)
Description:
Bug 33328: Rename x-marc-schema => x-record-schema
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-03-23 22:53:22 UTC
Size:
2.83 KB
patch
obsolete
>From 6eb5d34df64e84d29a790c55478fe0796a34768c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 23 Mar 2023 19:46:48 -0300 >Subject: [PATCH] Bug 33328: Rename x-marc-schema => x-record-schema > >This patch renames the header on the biblio API so it is not entirely >tied to MARC, trying to follow the biblio_metadata table generic >approach. > >To test: >1. Apply this patch >2. Run: > $ prove t/db_dependent/api/v1/biblios.t >=> SUCCESS: Tests pass >3. You agree with the change? >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Biblios.pm | 4 ++-- > api/v1/swagger/swagger.yaml | 2 +- > t/db_dependent/api/v1/biblios.t | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 9227a6af8a4..ed071a5dc54 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -493,7 +493,7 @@ sub add { > try { > my $headers = $c->req->headers; > >- my $flavour = $headers->header('x-marc-schema'); >+ my $flavour = $headers->header('x-record-schema'); > $flavour //= C4::Context->preference('marcflavour'); > > my $record; >@@ -568,7 +568,7 @@ sub update { > try { > my $headers = $c->req->headers; > >- my $flavour = $headers->header('x-marc-schema'); >+ my $flavour = $headers->header('x-record-schema'); > $flavour //= C4::Context->preference('marcflavour'); > > my $frameworkcode = $headers->header('x-framework-id') || $biblio->frameworkcode; >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index 6f7d6972ab9..2967f20ee12 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -382,7 +382,7 @@ parameters: > type: string > marc_schema_header: > description: March schema. One of MARC21 or UNIMARC >- name: x-marc-schema >+ name: x-record-schema > in: header > required: false > type: string >diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t >index afff055e360..8be6b4b56ef 100755 >--- a/t/db_dependent/api/v1/biblios.t >+++ b/t/db_dependent/api/v1/biblios.t >@@ -1125,8 +1125,8 @@ subtest 'post() tests' => sub { > } > ); > >- $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-marc-schema" => 'INVALID'}) >- ->status_is(400, 'Invalid header x-marc-schema'); >+ $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-record-schema" => 'INVALID'}) >+ ->status_is(400, 'Invalid header x-record-schema'); > > $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode} => $marcxml) > ->status_is(200) >-- >2.40.0
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 33328
:
148626
|
149671
|
150500