swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.98k stars 6.03k forks source link

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

Open SonnyRajagopalan opened 7 years ago

SonnyRajagopalan commented 7 years ago
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.

SonnyRajagopalan commented 7 years ago

I can confirm that basicAuth security example does not show up the auth credentials either in the generated swagger UI.