jhthorsen / openapi-client

A client for talking to an Open API powered server
11 stars 17 forks source link

OpenAPI::Client rejecting schema accepted by Swagger2::Client #6

Closed gquipster closed 6 years ago

gquipster commented 6 years ago

Hi,

Atempting to load schema results in error of:

Invalid JSON specification HASH(0x11c7348):

securityDefinitions in API schema looks like:

  "securityDefinitions": {
    "myIdentity": {
      "flow": "implicit",
      "authorizationUrl": "https://identity.server.local/connect/authorize",
      "tokenUrl": "https://identity.server.local/connect/token",
      "scopes": {
        "myAPI": "The scope needed to access the API"
      },
      "type": "oauth2",
      "description": "My Identity Implicit Grant"
    }
  }

This worked with the Swagger2::Client.

Thanks

jhthorsen commented 6 years ago

Hi. Sorry for the late response...

It does not seem like tokenUrl can be present when flow is "implicit". The schema is valid if you either remove tokenUrl or change flow to "accessCode".

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securitySchemeObject