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

Add support for apiKey securityDefinitionsObject #108

@boosh

Description

@boosh

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.

Metadata

Metadata

Assignees

No one assigned

    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