OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
We have created a microservice using nest js. we are using openapi-generator-cli to generate client sdks. We are using swagger to consume open api definition. We have configured OAuth2 for 'Try it out' on Swagger UI to work with protected routes and also configured bearer Auth using documentbuilder.addOAuth2().addBearerAuth().
While generating client SDK for angular apps, it works perfectly fine -
But while generating client SDK in C# dotnet core using "openapi-generator-cli generate -g csharp-netcore -o XYZ/ -i openApi.json --additional-properties packageName=XYZ", we are unable to use it since two authorization headers were added in the generated code. It returns 401 on every API call through client SDK.
We have created a microservice using nest js. we are using openapi-generator-cli to generate client sdks. We are using swagger to consume open api definition. We have configured OAuth2 for 'Try it out' on Swagger UI to work with protected routes and also configured bearer Auth using documentbuilder.addOAuth2().addBearerAuth(). While generating client SDK for angular apps, it works perfectly fine - But while generating client SDK in C# dotnet core using "openapi-generator-cli generate -g csharp-netcore -o XYZ/ -i openApi.json --additional-properties packageName=XYZ", we are unable to use it since two authorization headers were added in the generated code. It returns 401 on every API call through client SDK.
Open API Generator Version - 2.3.5
https://github.com/OpenAPITools/openapi-generator-cli/issues/394