Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #8116
Closed
Open
Issue created Dec 07, 2020 by Administrator@rootContributor

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

Assignee
Assign to
Time tracking