Bugzilla – Attachment 164773 Details for
Bug 36505
Allow updating patron attributes via PUT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36505: (follow-up) Consistent error codes in POST
Bug-36505-follow-up-Consistent-error-codes-in-POST.patch (text/plain), 2.48 KB, created by
Brendan Lawlor
on 2024-04-11 15:34:56 UTC
(
hide
)
Description:
Bug 36505: (follow-up) Consistent error codes in POST
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-04-11 15:34:56 UTC
Size:
2.48 KB
patch
obsolete
>From 2fcd44156d7bd4531a43dbf05f253e92e0cc3942 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 9 Apr 2024 08:56:00 +0200 >Subject: [PATCH] Bug 36505: (follow-up) Consistent error codes in POST > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > Koha/REST/V1/Patrons.pm | 8 ++++---- > api/v1/swagger/paths/patrons.yaml | 8 +++++++- > 2 files changed, 11 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm >index 81aca249fd..ca620109a0 100644 >--- a/Koha/REST/V1/Patrons.pm >+++ b/Koha/REST/V1/Patrons.pm >@@ -212,7 +212,7 @@ sub add { > { > return $c->render( > status => 400, >- openapi => { error => "$_" } >+ openapi => { error => "$_", error_code => 'missing_mandatory_attribute' } > ); > } > elsif ( >@@ -221,7 +221,7 @@ sub add { > { > return $c->render( > status => 400, >- openapi => { error => "$_" } >+ openapi => { error => "$_", error_code => 'invalid_attribute_type' } > ); > } > elsif ( >@@ -230,7 +230,7 @@ sub add { > { > return $c->render( > status => 400, >- openapi => { error => "$_" } >+ openapi => { error => "$_", error_code => 'non_repeatable_attribute' } > ); > } > elsif ( >@@ -239,7 +239,7 @@ sub add { > { > return $c->render( > status => 400, >- openapi => { error => "$_" } >+ openapi => { error => "$_", error_code => 'attribute_not_unique' } > ); > } > } >diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml >index 68649d10bd..26ef12e0ce 100644 >--- a/api/v1/swagger/paths/patrons.yaml >+++ b/api/v1/swagger/paths/patrons.yaml >@@ -434,7 +434,13 @@ > items: > $ref: "../swagger.yaml#/definitions/patron" > "400": >- description: Bad parameter >+ description: | >+ Bad parameter. Possible `error_code` attribute values: >+ >+ * `invalid_attribute_type` >+ * `attribute_not_unique` >+ * `non_repeatable_attribute` >+ * `missing_mandatory_attribute` > schema: > $ref: "../swagger.yaml#/definitions/error" > "401": >-- >2.39.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 36505
:
164499
|
164500
|
164527
|
164771
|
164772
|
164773
|
165409
|
165410
|
165411