Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Empty response schema generates an exception "Unknown media type schema type"

Open
#1,157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start by reproducing the issue with the OpenAPI response example containing empty application/json and application/xml content objects. Trace the media-type schema handling that raises "Unknown media type schema type"; done means valid responses without schemas generate successfully without that exception.

Written by the indexing model from the issue text.

Description

Describe the bug

"responses": {
  "400": {
    "description": "There was a problem with the data sent with the request.",
    "content": {
      "application/json": {},
      "application/xml": {}
    }
  }
}

Not having a schema on the returned content will generate an "Unknown media type schema type" exception. This is valid schema and many code first schema generators create this type of output.

Desktop (please complete the following information):

  • OS: macOS 10.13.7
  • Python Version: 3.10.15
  • openapi-python-client version 0.5.0
Dominant language
Python
Stars
2k
Forks
293
Avg merge
34m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openapi-generators/openapi-python-client

All issues in openapi-generators/openapi-python-client

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.