Skip to content

Swagger expand add invalid authorizationUrl key in securityDefinitions #2506

@ghost

Description

Problem statement

When using swagger expand on a Swagger document with a OAuth2 flow: application security definition, expand adds an invalid empty string key authorizationUrl to the security definition.

The authorizationUrl key is only valid when used with flow: implicit or accessCode, not with application.

Swagger specification

swagger: "2.0"
securityDefinitions:
  OAuth2:
    type: oauth2
    flow: application
    tokenUrl: https://example.com/oauth/token

Steps to reproduce

  1. Run swagger expand test.yaml
  2. The output contains an empty string key authorizationUrl in the key
swagger: "2.0"
paths: null
securityDefinitions:
  OAuth2:
    type: oauth2
    flow: application
    authorizationUrl: ""
    tokenUrl: https://example.com/oauth/token

Environment

swagger version:

version: v0.26.0
commit: 640fa2f19f215cda0b815a4bb9a26aae2bd477d2

go version:
go version go1.15.3 darwin/amd64

OS: Mac OSX 10.14.5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions