Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing header descriptions in response raise exception #130

Open
cionz0 opened this issue Oct 9, 2022 · 1 comment
Open

Missing header descriptions in response raise exception #130

cionz0 opened this issue Oct 9, 2022 · 1 comment

Comments

@cionz0
Copy link

cionz0 commented Oct 9, 2022

In my sample project on AWS I've enabled cors and since then I get this error.

Exception occurred: File "/Users/cionzo/myproject/venv/lib/python3.8/site-packages/sphinxcontrib/openapi/openapi30.py", line 354, in _httpresource for line in convert(header['description']).splitlines(): KeyError: 'description'

It occurs at the point of generating the docs for the OPTIONS method (depending on the cors).
The openapi document is generated by aws apigateway, hence I have almost no control on it.

I suggest modifying line 354 of openapi30.py in order to cope with missing header descriptions and using a default value:

for line in convert(header.get('description', '')).splitlines():

@phofl
Copy link

phofl commented Nov 30, 2022

You can open a pr in https://github.com/phofl/openapi if you like, but will need tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants