Redoc: Authentication section appears twice

Created on 14 Feb 2019  路  5Comments  路  Source: Redocly/redoc

Hi! I've an issue with the Authentication header. The documentation says:

If Authentication header is already present in the description, Security Definitions won't be inserted
and rendered at all.

Here is an example:

Click

swagger: '2.0'
info:
  description: |
    # General description
    goes here    
     # Authentication 
     If `Authentication header` is already present in the description, Security Definitions won't be inserted and rendered at all.
  version: v1.2.3-beta
  title: Title

host: example.com
basePath: /v1/path
tags:
  - name: Tag1
    description: 'Tags'
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /:
    get:
      tags:
        - Tags
      summary: Summary
      description: 'Description'
      parameters:
        - name: param1
          in: query
          description: Text
          type: integer
      security:
        - API key: []
      deprecated: false
securityDefinitions:
  API key:
    type: apiKey
    name: x-api-key
    in: header



That renders as:

auth

Related issue

Am I doing something wrong here? Thanks in advance

Most helpful comment

I will check it out. Thanks

All 5 comments

Remove an extra-space before # Authentication header.

description: |
  # General description
  goes here    
  # Authentication 
  If `Authentication header` is already present in the description, Security Definitions won't be inserted and rendered at all.
version: v1.2.3-beta
title: Title

The issue still reproduces.

That:

swagger: '2.0'
info:
  description: |
    # General description
    goes here    
    # Authentication 
    If `Authentication header` is already present in the description, Security Definitions won't be inserted and rendered at all.
  version: v1.2.3-beta
  title: Title
host: example.com
basePath: /v1/path
tags:
  - name: Tag1
    description: 'Tags'
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /:
    get:
      tags:
        - Tags
      summary: Summary
      description: 'Description'
      parameters:
        - name: param1
          in: query
          description: Text
          type: integer
      security:
        - API key: []
      deprecated: false
securityDefinitions:
  API key:
    type: apiKey
    name: x-api-key
    in: header

still renders with the security definitions:

image

I will check it out. Thanks

Running into the same issue. Any luck finding the problem @RomanHotsiy ?

Is the issue only with OAS2?

Was this page helpful?
0 / 5 - 0 ratings