Bugzilla – Attachment 144750 Details for
Bug 31795
Add POST endpoint for Authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31795: (follow-up) fix header name
Bug-31795-follow-up-fix-header-name.patch (text/plain), 3.60 KB, created by
David Nind
on 2022-12-20 22:23:28 UTC
(
hide
)
Description:
Bug 31795: (follow-up) fix header name
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-12-20 22:23:28 UTC
Size:
3.60 KB
patch
obsolete
>From 0887ef310dab6554722c751e1604f46bb927b046 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 20 Dec 2022 19:41:07 +0000 >Subject: [PATCH] Bug 31795: (follow-up) fix header name > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/REST/V1/Authorities.pm | 4 ++-- > api/v1/swagger/swagger.yaml | 4 ++-- > t/db_dependent/api/v1/authorities.t | 6 +++--- > 3 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Authorities.pm b/Koha/REST/V1/Authorities.pm >index 109c038273..15a70070dd 100644 >--- a/Koha/REST/V1/Authorities.pm >+++ b/Koha/REST/V1/Authorities.pm >@@ -161,7 +161,7 @@ sub add { > $record = MARC::Record->new_from_xml( $body->{marcxml}, 'UTF-8', $flavour ); > $authtypecode = $body->{authtypecode}; > } else { >- $authtypecode = $c->validation->param('authority_type'); >+ $authtypecode = $c->validation->param('x-authority-type'); > if ( $c->req->headers->content_type =~ m/application\/marcxml\+xml/ ) { > $record = MARC::Record->new_from_xml( $body, 'UTF-8', $flavour ); > } elsif ( $c->req->headers->content_type =~ m/application\/marc-in-json/ ) { >@@ -184,7 +184,7 @@ sub add { > my ($duplicateauthid,$duplicateauthvalue); > ($duplicateauthid,$duplicateauthvalue) = FindDuplicateAuthority($record,$authtypecode); > >- my $confirm_not_duplicate = $c->validation->param('confirm_not_duplicate'); >+ my $confirm_not_duplicate = $c->validation->param('x-confirm-not-duplicate'); > > return $c->render( > status => 400, >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index f50153b68f..9f6fa66907 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -348,13 +348,13 @@ parameters: > type: integer > authority_type_header: > description: Authority type code. Use when content type is not application/json >- name: authority_type >+ name: x-authority-type > in: header > required: false > type: string > confirm_not_duplicate_header: > description: Confirm the posted element is not a duplicate >- name: confirm_not_duplicate >+ name: x-confirm-not-duplicate > in: header > required: false > type: integer >diff --git a/t/db_dependent/api/v1/authorities.t b/t/db_dependent/api/v1/authorities.t >index b9720163b5..03cd52e58a 100755 >--- a/t/db_dependent/api/v1/authorities.t >+++ b/t/db_dependent/api/v1/authorities.t >@@ -216,15 +216,15 @@ subtest 'post() tests' => sub { > ->status_is(200) > ->json_has('/id'); > >- $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marcxml+xml', authority_type => 'CORPO_NAME'} => $marcxml) >+ $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marcxml+xml', 'x-authority-type' => 'CORPO_NAME'} => $marcxml) > ->status_is(200) > ->json_has('/id'); > >- $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marc-in-json', authority_type => 'CORPO_NAME'} => $mij) >+ $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marc-in-json', 'x-authority-type' => 'CORPO_NAME'} => $mij) > ->status_is(200) > ->json_has('/id'); > >- $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marc', authority_type => 'CORPO_NAME'} => $marc) >+ $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marc', 'x-authority-type' => 'CORPO_NAME'} => $marc) > ->status_is(200) > ->json_has('/id'); > >-- >2.30.2
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 31795
:
144555
|
144746
|
144747
|
144749
|
144750
|
149380
|
149407
|
149409
|
149451
|
149459
|
149460
|
149461
|
149462
|
150370
|
150371
|
150372
|
150373