View | Details | Raw Unified | Return to bug 33328
Collapse All | Expand All

(-)a/Koha/REST/V1/Biblios.pm (-2 / +2 lines)
Lines 496-502 sub add { Link Here
496
    try {
496
    try {
497
        my $headers = $c->req->headers;
497
        my $headers = $c->req->headers;
498
498
499
        my $flavour = $headers->header('x-marc-schema');
499
        my $flavour = $headers->header('x-record-schema');
500
        $flavour //= C4::Context->preference('marcflavour');
500
        $flavour //= C4::Context->preference('marcflavour');
501
501
502
        my $record;
502
        my $record;
Lines 571-577 sub update { Link Here
571
    try {
571
    try {
572
        my $headers = $c->req->headers;
572
        my $headers = $c->req->headers;
573
573
574
        my $flavour = $headers->header('x-marc-schema');
574
        my $flavour = $headers->header('x-record-schema');
575
        $flavour //= C4::Context->preference('marcflavour');
575
        $flavour //= C4::Context->preference('marcflavour');
576
576
577
        my $frameworkcode = $headers->header('x-framework-id') || $biblio->frameworkcode;
577
        my $frameworkcode = $headers->header('x-framework-id') || $biblio->frameworkcode;
(-)a/api/v1/swagger/swagger.yaml (-1 / +1 lines)
Lines 384-390 parameters: Link Here
384
    type: string
384
    type: string
385
  marc_schema_header:
385
  marc_schema_header:
386
    description: March schema. One of MARC21 or UNIMARC
386
    description: March schema. One of MARC21 or UNIMARC
387
    name: x-marc-schema
387
    name: x-record-schema
388
    in: header
388
    in: header
389
    required: false
389
    required: false
390
    type: string
390
    type: string
(-)a/t/db_dependent/api/v1/biblios.t (-3 / +2 lines)
Lines 1156-1163 subtest 'post() tests' => sub { Link Here
1156
        }
1156
        }
1157
    );
1157
    );
1158
1158
1159
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-marc-schema" => 'INVALID'})
1159
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-record-schema" => 'INVALID'})
1160
      ->status_is(400, 'Invalid header x-marc-schema');
1160
      ->status_is(400, 'Invalid header x-record-schema');
1161
1161
1162
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode} => $marcxml)
1162
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode} => $marcxml)
1163
      ->status_is(200)
1163
      ->status_is(200)
1164
- 

Return to bug 33328