[REQ] Fix default Content-Type Header in Python client
Created by: telday
Is your feature request related to a problem? Please describe.
Currently in the Python client (at least, I have not verified for other generated clients) when there is no requestBody
key specified for a given path in the spec file the generated client will automatically set the Content-Type
header to application/json
. The biggest issue with this is that an empty request body is NOT valid JSON. Therefore the client effectively sends an invalid request to the server each time there is no request body specified. This is not a problem most of the time, however I have encountered issues with this when running against a Rails server.
Describe the solution you'd like
The Content-Type
header should default to either text/plain
or should be omitted if it is unnecessary.