From 18570614c404b662078a81cc0928e4807806bfc6 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Fri, 6 Oct 2017 13:20:01 -0600 Subject: [PATCH] Bug 18936: (follow-up) Update REST definition for /.../kinds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Minna Kivinen Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize --- Koha/REST/V1/CirculationRules.pm | 7 +++++-- api/v1/swagger/paths/circulation-rules.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Koha/REST/V1/CirculationRules.pm b/Koha/REST/V1/CirculationRules.pm index a04be03a94..539ed4e3ce 100644 --- a/Koha/REST/V1/CirculationRules.pm +++ b/Koha/REST/V1/CirculationRules.pm @@ -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; diff --git a/api/v1/swagger/paths/circulation-rules.json b/api/v1/swagger/paths/circulation-rules.json index e897cd7276..0f118d344e 100644 --- a/api/v1/swagger/paths/circulation-rules.json +++ b/api/v1/swagger/paths/circulation-rules.json @@ -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" -- 2.39.5