swagger-api / swagger-api/swagger-ui
Authorization (lock symbol) is rendered incorrectly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
I have endpoints that either have a required authorization or an optional authorization (see example).
I think the lock symbols are rendered incorrectly. It shows a black locked symbol for optional authorization (/public) and and a gray unlocked symbol for required authorization (/private).
| Q | A |
|---|---|
| Bug or feature request? | Bug |
| Which Swagger/OpenAPI version? | 3.0.0 and 2.0 |
| Which Swagger-UI version? | 3.x currently used by hosted Swagger Editor + master branch (03.04.2018 15:36) |
| How did you install Swagger-UI? | Hosted Swagger Editor + locally using master branch (03.04.2018 15:36) |
| Which browser & version? | Chrome 65.0.3325.181 |
| Which operating system? | Windows 10 |
Demonstration API definition
openapi: 3.0.0
servers:
- url: 'https://localhost/api/'
info:
title: OpenEO API
version: 0.3.0
paths:
/public:
get:
summary: This endpoint allows users to access it with AND without authentication.
security:
- {}
- Bearer: []
responses:
'200':
description: ...
/private:
get:
summary: This endpoint allows users to access it only with authentication.
security:
- Bearer: []
responses:
'200':
description: ...
components:
securitySchemes:
Bearer:
type: http
scheme: bearer
Expected Behavior
It shows a gray unlocked symbol for optional authorization (/public) and and a black locked symbol for required authorization (/private).
Current Behavior
It shows a black locked symbol for optional authorization (/public) and and a gray unlocked symbol for required authorization (/private).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied OpenAPI 3.0 example and trace how Swagger UI renders authorization symbols for operations with optional versus required security. Check the equivalent Swagger 2.0 behavior and identify the existing authorization rendering entry point or tests. Done means optional authorization shows a gray unlocked symbol and required authorization shows a black locked symbol for both formats.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100