diff options
author | gebele <gebele@in-silico.ch> | 2018-05-07 12:40:45 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2018-05-07 12:40:45 +0200 |
commit | 9f3dbafd5fd8d80eae529354efcef94aec8f7d48 (patch) | |
tree | 192e5ac3fac868f7fe5ca5c7a21167883d949ebf | |
parent | 3ecd85f1fd7c397d8544be61ba9c3dcc3ff301fe (diff) | |
parent | 909b34b31d71671b5e5a660cb78b5f1bc1a88b8b (diff) |
Merge branch 'development' of https://github.com/opentox/lazar-rest into developmentdevelopment
-rw-r--r-- | api/api.json | 9 | ||||
-rw-r--r-- | config.ru | 3 | ||||
-rw-r--r-- | lib/api.rb | 4 | ||||
-rw-r--r-- | lib/swagger.rb | 4 |
4 files changed, 8 insertions, 12 deletions
diff --git a/api/api.json b/api/api.json index 7777f1e..23dd1cc 100644 --- a/api/api.json +++ b/api/api.json @@ -709,7 +709,7 @@ "descriptor" ], "summary": "Descriptor calculation", - "description": "Calculate descriptors for a single compound as SMILES string <br> <strong>curl example:</strong> <pre>curl -Lk -X POST -i -H \"Accept:application/json\" -F \"identifier=O=C1NC(=O)NC=C1\" -F \"descriptor=Openbabel.MW,JoeLib.LogP\" https://api.in-silico.ch/compound/descriptor </pre>.", + "description": "Calculate descriptors for a single compound as SMILES string <br> <strong>curl example:</strong> <pre>curl -Lk -X POST -i -H \"Accept:application/json\" -F \"identifier=O=C1NC(=O)NC=C1\" -F \"descriptor=Openbabel.MW,Openbabel.atoms\" https://api.in-silico.ch/compound/descriptor </pre>.", "consumes": [ "multipart/form-data" ], @@ -724,12 +724,9 @@ { "name": "descriptor", "in": "formData", - "description": "array of descriptors", + "description": "list of comma seperated descriptors", "required": true, - "type": "array", - "items": { - "type": "string" - } + "type": "string" }, { "$ref": "#/parameters/subjectid" @@ -1,5 +1,4 @@ -SERVICE = "lazar-rest" require 'bundler' Bundler.require require File.expand_path './lib/lazar-rest.rb' -run Sinatra::Application
\ No newline at end of file +run Sinatra::Application @@ -2,8 +2,8 @@ get "/api/api.json" do response['Content-Type'] = "application/json" api_file = File.join("api", "api.json") - bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(api_file) + bad_request_error "API Documentation in Swagger JSON is not implemented." unless File.exists?(api_file) api_hash = JSON.parse(File.read(api_file)) api_hash["host"] = request.env['HTTP_HOST'] return api_hash.to_json -end
\ No newline at end of file +end diff --git a/lib/swagger.rb b/lib/swagger.rb index f6b42b2..9fa14f7 100644 --- a/lib/swagger.rb +++ b/lib/swagger.rb @@ -2,7 +2,7 @@ set :public_folder, File.join("/home/ist/swagger-ui/dist/") # route to swagger API file get "/" do response['Content-Type'] = "text/html" - index_file = File.join("/home/ist/swagger-ui/dist/index.html") - bad_request_error "API Documentation in Swagger JSON is not implemented.", uri("/#{SERVICE}/api") unless File.exists?(index_file) + index_file = File.join(ENV['HOME'],"swagger-ui/dist/index.html") + bad_request_error "API Documentation in Swagger JSON is not implemented." unless File.exists?(index_file) File.read(index_file) end |