swagger-codegen-generators icon indicating copy to clipboard operation
swagger-codegen-generators copied to clipboard

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

Open hsekowski opened this issue 1 year ago • 3 comments

(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.

hsekowski avatar May 02 '23 15:05 hsekowski

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!

Plonk42 avatar Aug 24 '23 08:08 Plonk42

Hi @Plonk42 , I'm just external contributor, who raised and issue and proposed a solution (https://github.com/swagger-api/swagger-codegen-generators/pull/1142) Some repo owner has to take a look and decide what to do with the PR and issue

hsekowski avatar Aug 24 '23 12:08 hsekowski

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.

Plonk42 avatar Aug 24 '23 13:08 Plonk42