Skip to content

C# Client Library when generated through openapi-generator-cli adds two authorization headers. #394

@ng13548

Description

@ng13548

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 -
image

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.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions