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

(-)a/Koha/REST/V1/Biblios.pm (-2 / +2 lines)
Lines 493-499 sub add { Link Here
493
    try {
493
    try {
494
        my $headers = $c->req->headers;
494
        my $headers = $c->req->headers;
495
495
496
        my $flavour = $headers->header('x-marc-schema');
496
        my $flavour = $headers->header('x-record-schema');
497
        $flavour //= C4::Context->preference('marcflavour');
497
        $flavour //= C4::Context->preference('marcflavour');
498
498
499
        my $record;
499
        my $record;
Lines 568-574 sub update { Link Here
568
    try {
568
    try {
569
        my $headers = $c->req->headers;
569
        my $headers = $c->req->headers;
570
570
571
        my $flavour = $headers->header('x-marc-schema');
571
        my $flavour = $headers->header('x-record-schema');
572
        $flavour //= C4::Context->preference('marcflavour');
572
        $flavour //= C4::Context->preference('marcflavour');
573
573
574
        my $frameworkcode = $headers->header('x-framework-id') || $biblio->frameworkcode;
574
        my $frameworkcode = $headers->header('x-framework-id') || $biblio->frameworkcode;
(-)a/api/v1/swagger/swagger.yaml (-1 / +1 lines)
Lines 382-388 parameters: Link Here
382
    type: string
382
    type: string
383
  marc_schema_header:
383
  marc_schema_header:
384
    description: March schema. One of MARC21 or UNIMARC
384
    description: March schema. One of MARC21 or UNIMARC
385
    name: x-marc-schema
385
    name: x-record-schema
386
    in: header
386
    in: header
387
    required: false
387
    required: false
388
    type: string
388
    type: string
(-)a/t/db_dependent/api/v1/biblios.t (-3 / +2 lines)
Lines 1125-1132 subtest 'post() tests' => sub { Link Here
1125
        }
1125
        }
1126
    );
1126
    );
1127
1127
1128
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-marc-schema" => 'INVALID'})
1128
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode, "x-record-schema" => 'INVALID'})
1129
      ->status_is(400, 'Invalid header x-marc-schema');
1129
      ->status_is(400, 'Invalid header x-record-schema');
1130
1130
1131
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode} => $marcxml)
1131
    $t->post_ok("//$userid:$password@/api/v1/biblios" => {'Content-Type' => 'application/marcxml+xml', 'x-framework-id' => $frameworkcode} => $marcxml)
1132
      ->status_is(200)
1132
      ->status_is(200)
1133
- 

Return to bug 33328