From 12f88bf241f653936cb3ed959a989cb71eca47f0 Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 23 Nov 2017 11:49:52 +0100 Subject: dropped SERVICE var --- config.ru | 3 +-- lib/api.rb | 4 ++-- lib/swagger.rb | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config.ru b/config.ru index 1dd7b70..fe7962c 100644 --- a/config.ru +++ b/config.ru @@ -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 diff --git a/lib/api.rb b/lib/api.rb index 98623dc..28e33df 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -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 -- cgit v1.2.3 From 63ca78ca7a2e60b080ae58667ebe9a4f245e409e Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 30 Jan 2018 14:11:56 +0000 Subject: changed input type from array to string to fix array of descriptors form data issue --- api/api.json | 9 +++------ 1 file changed, 3 insertions(+), 6 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
curl example:
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 
.", + "description": "Calculate descriptors for a single compound as SMILES string
curl example:
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 
.", "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" -- cgit v1.2.3