ng-swagger-gen and security definitions

(Francois Charette) #1

Hi,

I am new to npm and I am evaluating the Angular CLI plugin ng-swagger-gen.

Right now I can figure out how to get the security to work. The ng-swagger-gen home page says

This generator may not cover all corner cases of the Swagger 2.0 specification;

So how can I know if the security definition is one of the corners not covered ? I configured an OAuth2 password flow in the securityDefinition in my YAML Swagger file and linked it to a path. It didn’t have any effect on the auto generated code and I have to manualy edit that code to add my token to the header, since the header is created inside the generated service without any interaction with my code.

Also, is ng-swagger-gen based on Swagger Codegen ? Because the code I get when I generate an Angular Client with Swagger Codegen and with ng-swagger-gen are very different. Swagger Codegen does take my security definition into account and allow my to pass a token to the generated service so it can put it in the HTTP header.

Thanks.

1 Like

(John Gee) #2

Hi @charettef. This forum is focused on npm itself, and your question is about one of the many packages available. So you might get an answer here, but you might want to ask your question somewhere that targets experts with your package. I have moved your topic to #community:javascript.

You could open an issue on the project of interest: https://github.com/cyclosproject/ng-swagger-gen/issues

0 Likes

(system) closed #3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

0 Likes