swagger-api / swagger-api/swagger-codegen-generators

[Python] JSON request with body=None should produce empty payload

Open
#1,141 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

(this is a clone of https://github.com/swagger-api/swagger-codegen/issues/12138)
This issue is to reconsider change made as a consequence of https://github.com/swagger-api/swagger-codegen/issues/9558
Conclusions related to JSON semantic correctness are unquestionably correct. There is however HTTP Semantics with its legacy (https://www.rfc-editor.org/rfc/rfc9110#name-delete ), that was taken into account in OpenAPI 3.0 (see https://spec.openapis.org/oas/latest.html#operationObject ). As a consequence, the None body should be allowed for GET, HEAD and DELETE operations.

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 by tracing the Python generator's handling of JSON request bodies for GET, HEAD, and DELETE operations, then review the change made for swagger-codegen issue 9558 and compare it with issue 12138. Use the referenced HTTP Semantics and OpenAPI 3.0 sections to define the expected behavior; done means a None body produces an empty payload for those operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
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.