Skip to content

Paw-OpenAPI3Importer doesn't set "Grant Type" in Auth -> OAuth2 properly, when importing an endpoint with a security definition. #14

@paw-eloquent-safe

Description

@paw-eloquent-safe

Imagine we have the following OpenAPI definition:

{
    "openapi": "3.0.1",
    "info": {
      "title": "Example Api",
      "version": "v1"
    },
    "servers": [
      {
        "url": "https://example.org/",
        "description": "Example Server"
      }
    ],
    "paths": {
      "/users/register": {
        "post": {
          "tags": [
            "Users"
          ],
          "security": [
            {
              "oauth2-client-flow": []
            }
          ],
          "requestBody": {
            "content": {
                ...
            }
          },
          "responses": {
            "200": {
              "description": "Success"
            }
          }
        }
      }
    },
    "components": {
      "schemas": {
          ...
        },
      "securitySchemes": {
        "oauth2-client-flow": {
          "type": "oauth2",
          "flows": {
            "clientCredentials": {
              "tokenUrl": "https://example.org/auth/connect/token",
              "scopes": {}
            }
          }
        }
      }
    },
    "security": [
      {
        "oauth2-client-flow": []
      }
    ]
  }

Then when importing this I expect the "Grant Type" in Auth -> OAuth2 for /users/register to be set to "Client Credentials" with the "Acces Token URL" to be filled.

Instead it looks like this:
Screenshot 2022-06-09 at 12 04 58
While I expected this:
Screenshot 2022-06-09 at 12 09 10

Same story goes for all of the other flows. (I think, didn't test it, tho)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions