Description
Requests with no body parameters (ie, no request body) should not include a Content-Type header.
This was acknowledged to be a bug for the Java Feign client (see #6647), and was fixed. I'm asking for parity in the Python client.
Swagger-codegen version
2.3.0
Swagger declaration file content or url
swagger: '2.0'
basePath: /
schemes:
- http
paths:
'/toggle':
post:
summary: Toggle the switch
description: If switch is off, toggle to on, and vice versa.
responses:
200:
description: Success
Command line used for generation
swagger-codegen generate -i example.yaml -l python -o $OUTPUT_DIR
Steps to reproduce
Generate a python client using an API spec that includes a POST path with no body parameters. Use the client to make a request, and observe that the request has a "Content-Type" header.
Related issues/PRs
#5613
#6647
Suggest a fix/enhancement
Only add a Content-Type header is body parameters are specified: #6648
Description
Requests with no body parameters (ie, no request body) should not include a Content-Type header.
This was acknowledged to be a bug for the Java Feign client (see #6647), and was fixed. I'm asking for parity in the Python client.
Swagger-codegen version
2.3.0
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Generate a python client using an API spec that includes a POST path with no body parameters. Use the client to make a request, and observe that the request has a "Content-Type" header.
Related issues/PRs
#5613
#6647
Suggest a fix/enhancement
Only add a Content-Type header is body parameters are specified: #6648