docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

[Bug] Console warning: Duplicate key for multiple Security Schemes

Open blindaa121 opened this issue 3 years ago • 1 comments

Describe the bug

In some cases, certain API's require multiple security schemes for authentication. As of now, the current <SecuritySchemes /> component only supports a single security scheme render.

Screen Shot 2022-06-06 at 9 32 48 AM

Expected behavior

There should be unique keys for each security scheme element to rid of any React warnings in the console. In addition, the "Authorization:" title is repeated for each Security Scheme and should be refactored and restyled to only render once.

Current behavior

React related console warnings for duplicate keys and repeated "Authorization: " title.

Possible solution

Handling the duplicate keys should be straight-forward. As for the repeated "Authorization: " title, the <SecuritySchemes /> component can be refactored in a manner that renders a list and a single "Authorization: " title (for API's that require multiple security schemes)

Steps to reproduce

  1. Generate docs with IoT API
  2. Navigate to any IoT API doc page
  3. Observe console warnings
  4. Observe duplicate "Authorization: " title

Screenshots

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:

blindaa121 avatar Jun 06 '22 17:06 blindaa121

:tada: Thanks for opening your first issue here! Welcome to the community!