swagger-api / swagger-api/swagger-codegen

Security section is not present in Swagger UI generated by Swagger codegen, but present in swagger editor

Open
#5,188 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

My security definitions are available on swagger-editor, but not on swagger UI generated via swagger-codegen. The Security section is seen in the swagger-editor for the pertinent swagger.yaml, but when nodejs code is generated for this and viewed as a UI, the security section isn't present for the

Swagger-codegen version

I think I am using 2.2.3-SNAPSHOT (from pom.xml).

Swagger declaration file content or url

https://gist.github.com/SonnyRajagopalan/7557f94b433cc7b8405d0a1f55b9ca85

The gist also contains a GUI view of the bug in the comments.

Command line used for generation
$ java -jar $SWAGGER_CODEGEN_CLI/target/swagger-codegen-cli.jar generate -i noname.yaml -l nodejs-server -o /somedir/
Steps to reproduce

To reproduce, just run the command above with the swagger file in the gist.

Related issues

Could be related to https://github.com/swagger-api/swagger-codegen/issues/3947, https://github.com/swagger-api/swagger-codegen/issues/1158 and a number of others that pertain to security in swagger-codegen.

Suggest a Fix

I do not have a fix for this at the moment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the supplied swagger.yaml gist and the nodejs-server generator invoked by the Java CLI; compare its generated UI with Swagger Editor's Security section. Done means the generated UI exposes the security definitions from that declaration, with the behavior verified using the reproduction command.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, openapi
Domain
api, security, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.