OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.51k stars 6.27k forks source link

[BUG][JAVA] APIClient.mustache template for apache-httplient library unnecessarily verifies if method allows request body #18979

Open wojciechkl opened 1 week ago

wojciechkl commented 1 week ago

Bug Report Checklist

Description

Validation code here https://github.com/OpenAPITools/openapi-generator/blob/cf303d4e034ce9d8eb194fb4e37a1f3409814cf9/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache#L1096 prevents me from sending GET request with body data.

I'm using OpenApi version 3.1.0 which explicitly allows to have request body in GET methods.

openapi-generator version

All

Suggest a fix

Remove this validation and leave it for http library to decide if method can have request body.

wing328 commented 1 week ago

can you please file a PR with the suggested fix?