Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Add support for apiKey securityDefinitionsObject #108

Closed
boosh opened this issue Nov 3, 2016 · 2 comments
Closed

Add support for apiKey securityDefinitionsObject #108

boosh opened this issue Nov 3, 2016 · 2 comments

Comments

@boosh
Copy link

boosh commented Nov 3, 2016

This annotation doesn't produce valid output:

@Api(
  value = "/users",
  produces = "application/json",
  consumes = "application/json",
  authorizations = Array(new Authorization(value="apiKey"))
)

It should produce an accompanying securityDefinition object something like:

    "securityDefinitions" :  { 
      "apiKey": {
        "type": "apiKey",
        "name": "X-Auth-Token",
        "in": "header" 
      }
    },

Instead it just produces the following:

"security" : [ {
          "apiKey" : [ ]
        } ]

See the docs here.

Does the library not support API key security definitions (and if so please can it be added) or am I doing something wrong? If I post the above output into the swagger UI it complains there's no security definition for apiKey. The docs show it should take an in parameter and a name.

How can I annotate my API classes so that swagger-play generates the correct security definitions for an X-Auth-Token security header token?

There's an example of adding an API key definition here.

@snhariharan
Copy link

Any plans of getting this merged?

frantuma added a commit that referenced this issue Apr 8, 2019
ref #108, ref #182 - security definitions support and versions updates
@frantuma
Copy link
Member

frantuma commented Apr 8, 2019

#192 introduces handling of both api key and oauth2 security definition support in play 2.6

@frantuma frantuma closed this as completed Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants