sphinx-contrib / sphinx-contrib/openapi
Parsing fails when a response includes a header without a description
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 126
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
The exception looks like this:
Exception occurred:
File "/usr/local/lib/python3.7/site-packages/sphinxcontrib/openapi/openapi20.py", line 75, in _httpresource
for line in convert(header['description']).splitlines():
KeyError: 'description'
It appears to be because _httpresource blindly defererences header['description']. According to HeaderObject the description field is not required.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in openapi20.py at the _httpresource method, especially line 75 where header['description'] is accessed. Reproduce the failure with an OpenAPI response header that omits description, then verify parsing completes without a KeyError and existing behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100