openapi
openapi copied to clipboard
HTTP response codes - cannot be like '4XX', must be integer or start with an integer
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:
...
It seems to originate from the sphinxcontrib-httpdomain dependency, adding http_strict_mode = False to conf.py seems to fix it