swagger-api/swagger-codegen-generators

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

hsekowski opened this issue · 3 comments

(this is a clone of swagger-api/swagger-codegen#12138)
This issue is to reconsider change made as a consequence of swagger-api/swagger-codegen#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.

Hey @hsekowski . Any chance we can get this fix merged? I'm encountering the exact same issue where {} is sent during a POST when I'd want to be no body at all.
Thanks!

Hi @Plonk42 ,
I'm just external contributor, who raised and issue and proposed a solution (#1142)
Some repo owner has to take a look and decide what to do with the PR and issue

Oh sorry I was confused, I didn't realized the mentioned commit was pushed to you own fork. Thanks anyway for the fix, I'll apply it manually until it gets eventually merged.