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> Signed-off-by: Magnus Enger <magnus@libriotech.no> Change sounds reasonable. Tests pass before and after patch. "grep -r "x-marc-schema" *" confirms no occurrences after patch. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
a3a58b93c3
commit
00629fe94f
3 changed files with 5 additions and 5 deletions
|
@ -496,7 +496,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;
|
||||
|
@ -571,7 +571,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;
|
||||
|
|
|
@ -384,7 +384,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
|
||||
|
|
|
@ -1156,8 +1156,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)
|
||||
|
|
Loading…
Reference in a new issue