api2swagger
api2swagger copied to clipboard
Execution error
Hi,
Two thumbs up for a great tool!
I got an error as follows when I tried it on a new IBM API. I know that the API requires a username and password, which I did not supply - just to see what happened. (Curl would have used -u "username:password").
In any event, I thought you would would want to know this.
$ api2swagger -X GET -e https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze -o xx ? Title of Swagger Spec ? ibm nlu ? Description of Swagger Spec ? nat lang ? Terms of Service URL ? http://example.com/about/terms ? Version of your API Program ? 2017-02-27 ? Contact Name? cg ? Contact URL ? http://example.com/contact ? Contact Email ? [email protected] ? License Name ? Apache 2.0 ? License URL ? http://example.com ? Does your API supports http ? No ? Pick Base Path from your API ? /natural-language-understanding/api/v1/analyze ? A verbose explanation of the operation behavior. ? API Method Description ? A short summary of what the operation does. ? Short Summary of API Method ? Additional external documentation for this operation. ? http://docs.example.com/management/apis/get/entities ? Unique string used to identify the operation. ? aa ? A list of tags for API documentation control. ? api2swagger Making an API Call & fetching more details...Please stay tuned.. /usr/local/lib/node_modules/api2swagger/lib/execute/api.js:290 if (response.headers['content-type'].indexOf('application/json') > -1 && body != '') { ^
TypeError: Cannot read property 'indexOf' of undefined
at Request._callback (/usr/local/lib/node_modules/api2swagger/lib/execute/api.js:290:41)
at Request.self.callback (/usr/local/lib/node_modules/api2swagger/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:194:7)
at Request.
Colin Goldberg
Unfortunately I'm experiencing that exact same problem. Did you find a solution or workaround? Thx!
I'm having this problem too. I'll submit a PR to fix it
exact same issue I am facing too.
Getting this issue also via npm 7.5.3 / nodejs v15.10.0 / macos catalina