summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2015-05-21 13:33:10 +0200
committerrautenberg <rautenberg@in-silico.ch>2015-05-21 13:33:10 +0200
commitf6638690a0d0f474011c4d63f75607983b5957dd (patch)
tree3f0e38433cd17ec1267f3acb6ab123d70926e22a
parenta2090d5f5489c8366bc3db66da63af1ba941f1f0 (diff)
add generic and unique route /SERVICE/api/SERVICE.json to swagger.json file
-rw-r--r--lib/opentox.rb4
1 files 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