Skip to content

Execution error #5

@colingoldberg

Description

@colingoldberg

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 ? apidocs@example.com
? 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. (/usr/local/lib/node_modules/api2swagger/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at IncomingMessage. (/usr/local/lib/node_modules/api2swagger/node_modules/request/request.js:1091:12)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:91:20)

Colin Goldberg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions