Python generated code: Delete API Requests can be blocked in API Gateways when sends empty body

Open Beginner friendly
#1,387 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with src/main/resources/handlebars/python/rest.mustache at line 150, where the generated DELETE request body is handled. Verify the generated Python client currently sends an empty body by default, then confirm that the completed change makes the DELETE request send no body when none is provided.

Written by the indexing model from the issue text.

Description

API Request for DELETE should not send anything by default; the current behavior sends an empty body
send: b'{}'
reply: 'HTTP/1.1 403 Forbidden\r\n'

Need to set {} to None
https://github.com/swagger-api/swagger-codegen-generators/blob/39a2bcd51eb9acf81ee0a7dc23d7cd1059c0c957/src/main/resources/handlebars/python/rest.mustache#L150

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

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.

More from swagger-api/swagger-codegen-generators

All issues in swagger-api/swagger-codegen-generators

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.