swagger-api / swagger-api/swagger-codegen

[typescript-fetch] HTTP 204 - Client leave exception

Open
#10,470 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Hello !
If I have time, I would propose PR, otherwise someone will do it (I hope ❤)

Describe the bug
In the case of a REST call that returns a 204 (No-Content)

https://github.com/swagger-api/swagger-codegen/blob/b821aab2df0ce93ca26953ab46d01d11521af0fa/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache#L269

The client leave exception here :

https://github.com/swagger-api/swagger-codegen/blob/b821aab2df0ce93ca26953ab46d01d11521af0fa/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache#L270

Expected behavior
The client must be return promise with null response

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 in modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache at the referenced lines around 269-270, and inspect how a 204 response is handled. Done means a generated TypeScript Fetch client returns a promise resolving to null for a 204 response instead of throwing an exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.