sphinx-contrib / sphinx-contrib/openapi

HTTP response codes - cannot be like '4XX', must be integer or start with an integer

Open
#104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
126
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Whilst the openapi spec allows HTTP codes for responses objects to be of type 2XX or 4XX (link) indicating a range of codes, this sphinx contrib seems unable to use those response codes appearing in a spec, with a warning:

(ERROR/3) HTTP status code must be an integer (e.g. 200) or start with an integer (e.g. 200 OK); <#text: '4XX'> is invalid

Not sure if the issue originates in the sphinxcontrib.openapi or in a dependency.

Way to reproduce: use an openapi.yaml spec with something like this in its paths:

paths:
  /myendpoint:
    post:
      requestBody:
      ...
      responses:
        '4XX':
          description: ...
          content:
             ...

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the warning with the OpenAPI YAML example in the issue, then trace the response-code validation or rendering entry point that emits it. Compare the accepted keys with the OpenAPI 3.0.2 Responses Object rules. Done means response keys such as 4XX are accepted without the invalid-status warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.