openapi icon indicating copy to clipboard operation
openapi copied to clipboard

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

Open ibiris opened this issue 4 years ago • 1 comments

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

ibiris avatar Nov 26 '20 12:11 ibiris

It seems to originate from the sphinxcontrib-httpdomain dependency, adding http_strict_mode = False to conf.py seems to fix it

st3v3nmw avatar Oct 19 '22 05:10 st3v3nmw