Skip to content

Invalid URI (missing protocol) #32

@ind1go

Description

@ind1go

I'm using the oasgraph CLI, with a Swagger doc generated from Liberty's built-in API explorer - i.e. I go to /ibm/api/docs and download the JSON it gives me.

When I run a GraphQL request, I get the following response:

{
  "errors": [
    {
      "message": "Invalid URI \"//host:27634/path/to/api\"",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "sysplex"
      ]
    }
  ],
  "data": {
    "sysplex": null
  }
}

It appears that the protocol is not being added to the URI.

With trace on I see:

 http Call GET //host:27634/path/to/api? headers:{"content-type":"application/json","accept":"application/json"} +0ms
  http Error: Invalid URI "//host:27634/path/to/api"
  http     at Request.init (/path/oasgraph/node_modules/request/request.js:273:31)
  http     at new Request (/path/oasgraph/node_modules/request/request.js:127:8)
  http     at request (/path/oasgraph/node_modules/request/index.js:53:10)
  http     at Promise (/path/oasgraph/lib/resolver_builder.js:161:13)
  http     at new Promise (<anonymous>)
  http     at /path/oasgraph/lib/resolver_builder.js:160:16
  http     at resolveFieldValueOrError (/path/oasgraph/node_modules/graphql/execution/execute.js:479:18)
  http     at resolveField (/path/oasgraph/node_modules/graphql/execution/execute.js:446:16)
  http     at executeFields (/path/oasgraph/node_modules/graphql/execution/execute.js:293:18)
  http     at executeOperation (/path/oasgraph/node_modules/graphql/execution/execute.js:237:122) +3ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions