OpenAPITools / OpenAPITools/openapi-generator

[BUG] Typescript generated code does not pass bearer token in HTTP headers

Open
#10,694 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Typescript generated code does not pass bearer token in HTTP headers.

openapi-generator version

5.0.0

OpenAPI declaration file content or url

It's a closed source project, I can't post here. Sorry.

Generation Details

npx @openapitools/openapi-generator-cli generate -i ../../wwwroot/swagger-original.json -g typescript-axios -o ../src/api-client/

Steps to reproduce

Execute the command in previous paragraph.

Suggest a fix

Set the bearer token in HTTP headers.

Best regards,
Giacomo Stelluti Scala

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

Start with the typescript-axios generator using the reported npx @openapitools/openapi-generator-cli generate command; the closed-source OpenAPI declaration is required to reproduce the problem. Trace how bearer authentication is represented in the generated client, and consider the issue done when generated requests include the bearer token in their HTTP headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.