From 45ddfb793631acb1ef4b10cbb8f6242e0d9dc1eb Mon Sep 17 00:00:00 2001 From: rautenberg Date: Thu, 18 Jun 2015 16:27:41 +0200 Subject: hotfix for wrong PATH_INFO in request env /algorithm/api/algorithm.json is /api/algorithm.json --- application.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application.rb b/application.rb index 9f1f12f..f2f2fab 100644 --- a/application.rb +++ b/application.rb @@ -39,5 +39,14 @@ module OpenTox #to('/feature-selection/recursive-feature-elimination', :full), to('/descriptor') ].join("\n") + "\n" end + + # generic route to swagger API file - hotfix because opentox-server route do not work + get "/algorithm/api/algorithm.json" do + response['Content-Type'] = "application/json" + api_file = File.join("api", "algorithm.json") + bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/algorithm/api") unless File.exists?(api_file) + File.read(api_file) + end + end end -- cgit v1.2.3