Skip to content

api key name and location is ignored #38

@x12a1f

Description

@x12a1f

The api key name and in options are ignored. Instead the api key is always added to the request using the query argument key

When having

 "securityDefinitions": {
    "some_key": {
      "type": "apiKey",
      "name": "myApiKey",
      "in": "header"
    }
  }

and

selection_214

the key is not added as a header but as a query argument named key:

selection_215

After changing the security definition to use a query like so:

 "securityDefinitions": {
    "some_key": {
      "type": "apiKey",
      "name": "myApiKey",
      "in": "query"
    }
  }

the query argument key is still used and not myApiKey.

Minimal example to reproduce:

{
  "x-navigateMethodsByName": true,
  "info": {
    "title": "minimal"
  },
  "swagger": "2.0",
  "host": "localhost:3123",
  "paths": {
    "/account": {
      "get": {
        "summary": "list",
        "security": [ { "some_key": [] } ],
        "responses": {
          "200": {
            "description": "Success",
              "schema": {
                  "title": "response",
                  "type": "string"
            }
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "some_key": {
      "type": "apiKey",
      "name": "myApiKey",
      "in": "query"
    }
  }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions