From f6638690a0d0f474011c4d63f75607983b5957dd Mon Sep 17 00:00:00 2001 From: rautenberg Date: Thu, 21 May 2015 13:33:10 +0200 Subject: add generic and unique route /SERVICE/api/SERVICE.json to swagger.json file --- lib/opentox.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/opentox.rb b/lib/opentox.rb index c14d352..6afcd35 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -197,9 +197,9 @@ module OpenTox end # generic route to swagger API file - get "/#{SERVICE}/api/?" do + get "/#{SERVICE}/api/#{SERVICE}.json" do response['Content-Type'] = "application/json" - api_file = File.join('api', 'swagger.json') + api_file = File.join('api', '#{SERVICE}.json') bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(api_file) File.read(api_file) end -- cgit v1.2.3