Bug 15496: (QA follow-up) Change success status on api
authorJosef Moravec <josef.moravec@gmail.com>
Wed, 17 Apr 2019 10:47:06 +0000 (10:47 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 26 Apr 2019 12:06:58 +0000 (12:06 +0000)
DELETE response code must be 204, not 200 according to our API coding
guidelines

Test plan:

prove t/db_dependent/api/v1/biblios.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/REST/V1/Biblios.pm
api/v1/swagger/paths/biblios.json
t/db_dependent/api/v1/biblios.t

index d5e5564..6e8da01 100644 (file)
@@ -54,7 +54,7 @@ sub delete {
             );
         }
         else {
-            return $c->render( status => 200, openapi => "" );
+            return $c->render( status => 204, openapi => "" );
         }
     }
     catch {
index 73ace63..f91d41c 100644 (file)
@@ -11,7 +11,7 @@
         "application/json"
       ],
       "responses": {
-        "200": {
+        "204": {
           "description": "Biblio deleted",
           "schema": {
             "type": "string"
index 03ef7cd..6a503b5 100644 (file)
@@ -62,7 +62,8 @@ subtest 'delete() tests' => sub {
 
     # Bibs with no items can be deleted
     $t->delete_ok("//$userid:$password@/api/v1/biblios/$biblio_id")
-      ->status_is(200)->content_is(q{""});
+      ->status_is(204, 'SWAGGER3.2.4')
+      ->content_is('', 'SWAGGER3.3.4');
 
     $t->delete_ok("//$userid:$password@/api/v1/biblios/$biblio_id")
       ->status_is(404);