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

Yaml: status codes are converted as integers

Open
#54 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reading jsonschema/_utils.py around line 104 and trace how YAML response-code keys reach that validation path. Reproduce the provided OpenAPI YAML example, then determine the expected handling and error behavior for integer status codes; done means the schema no longer trips over unquoted response codes and failures are informative.

Written by the indexing model from the issue text.

Description

kind/bug/confirmed

When writing status codes in yaml as:

reponses:
   200:
     description: OK

They are internally converted to integers and json_schema trips over them here. In addition this isn't caught and so the default TypeError: expected string or bytes-like object tells you nothing.

The same schema converted to Json by ApiMatic converts status codes to strings and so the work around is to quote the response codes in your yaml file.

Dominant language
Python
Stars
368
Forks
140
PR merge metrics
No merged PRs in 30d

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 python-openapi/openapi-core

All issues in python-openapi/openapi-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.