Closed jesseproudman closed 8 years ago
Thank you your contribution.
The patch for the method 'rest_access_without_body' did not work well.
c:/Ruby/lib/ruby/gems/2.2.0/gems/rest-client-2.0.0-x86-mingw32/lib/restclient/resource.rb:65:in post': wrong number of arguments (0 for 1..2) (ArgumentError) from C:/Projects/Schema/test/examples/watson-api-client.rb:154:in
rest_access_without_body'
from (eval):2:in block (2 levels) in initialize' from watson_api_example_4th.rb:47:in
The version of rest-client is also the same result in 2.0 in 1.8.
I think if the patch is made the method 'rest_access_without_body', some similar patch should be necessary to the method 'rest_access_with_body'.
Is watson_api_example_4th.rb available some where? The patched version I submitted works with the code I'm trying so it'd be great to see how you're kicking everything off.
The difference between rest_access_without_body is that it pushes as a HTTP GET so all the parameters need to be in the URL while rest_access_with_body is an HTTP POST.
'watson_api_example_4th.rb' is just carrying out the example written in README.md simply. The above-mentioned exception occurs in RelationshipExtraction#extract. 'rest_access_without_body' handles cases of both of 'post' and 'get'. This is the specification of the Watson API side.
path = path +"?" + URI.encode_www_form(options)
It seems that this code should be performed on the rest-client gem side primarily. So I confirmed the internal code of rest-client gem. In case of 'get', 'options' probably seems to have to be nested by the key ':params'.
- path = path + "?" + URI.encode_www_form(options)
- @service[path].send(access)
+ options = {:params=>options} if access.downcase == 'get'
+ @service[path].send(access, options)
It may work by correction like the above, could you check it?
Concerning about URL changes, it's best that the IBM side provides Swagger 2.0 version of the following URL(*). I requested it at several courses, but unfortunately have got no reactions yet.
About the provision of the list of APIs, could you help me?
You're correct. I've fixed that in #5.
I'm working inside IBM to try to get that master listing.
Fixes the URL issues registered in #1.