Bug 18936: (follow-up) Update REST definition for /.../kinds
authorJesse Weaver <pianohacker@gmail.com>
Fri, 6 Oct 2017 19:20:01 +0000 (13:20 -0600)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 4 Feb 2020 09:56:24 +0000 (09:56 +0000)
Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha/REST/V1/CirculationRules.pm
api/v1/swagger/paths/circulation-rules.json

index a04be03..539ed4e 100644 (file)
@@ -24,9 +24,12 @@ use Koha::CirculationRules;
 use Try::Tiny;
 
 sub get_kinds {
-    my ( $c, $args, $cb ) = @_;
+    my $c = shift->openapi->valid_input or return;
 
-    return $c->$cb( Koha::CirculationRules->rule_kinds, 200 );
+    return $c->render(
+        status => 200,
+        openapi => Koha::CirculationRules->rule_kinds,
+    );
 }
 
 1;
index e897cd7..0f118d3 100644 (file)
@@ -1,8 +1,8 @@
 {
   "/circulation-rules/kinds": {
     "get": {
-      "x-mojo-controller": "Koha::REST::V1::CirculationRules",
-      "operationId": "get_kinds",
+      "x-mojo-to": "CirculationRules#get_kinds",
+      "operationId": "getCirculationRuleKinds",
       "tags": ["cities"],
       "produces": [
         "application/json"