Skip to content

Add the expected Authentication requirement in SwaggerUI #384

@bvandewe

Description

@bvandewe

What would you like to be added:

Since the API expects the Authorization header set to a configured static token, it'd be useful if SwaggerUI had the corresponding definition so that users can effectively input the header's value and use the API.

As far as i can tell, a "API KEY" authentication configured as follows would work:

{
  "openapi": "3.0.0",
  "info": {
    "title": "API with API Key Authentication",
    "version": "1.0.0"
  },
  "paths": {
    "/example": {
      "get": {
        "summary": "Example endpoint",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  }
}

Why is this needed: Users receive 401 on all endpoints when using SwaggerUI...

Metadata

Metadata

Assignees

Labels

app: apiConcerns the APIpriority: lowIndicates a low priority issuetype: enhancementNew feature or requestweight: 2An issue with a low development impact

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions