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

Fix KeyError when using OpenAPI v3 specification #17

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@TristanCacqueray

TristanCacqueray commented Dec 22, 2017

In v3, the parameters doesn't have a 'type' resulting in this error:
File "sphinxcontrib/openapi.py", line 94, in _httpresource
yield indent + ':param {type} {name}:'.format(**param)
KeyError: 'type'

This change adds partial OpenAPI v3 support by adding a default
'string' type in the _normalize_spec function.

Fix KeyError when using OpenAPI v3 specification
In v3, the parameters doesn't have a 'type' resulting in this error:
  File "sphinxcontrib/openapi.py", line 94, in _httpresource
    yield indent + ':param {type} {name}:'.format(**param)
  KeyError: 'type'

This change adds partial OpenAPI v3 support by adding a default
'string' type in the _normalize_spec function.
@ikalnytskyi

This comment has been minimized.

Owner

ikalnytskyi commented Dec 30, 2017

@TristanCacqueray thanks for the PR! I'm not sure that this is the best way to support v3 as there might be other issues. I'll take a look at changes done in OpenAPI v3 once I got some time.

@amn41

This comment has been minimized.

amn41 commented Jun 29, 2018

hi! thanks for this project. looks super cool and I'm keen to try it out. How much work would be involved in supporting openAPI v3? I'd be happy to look into this, if it's something you are still interested in

@ikalnytskyi

This comment has been minimized.

Owner

ikalnytskyi commented Jul 28, 2018

@amn41 sorry for the later reply. I'm sorry I cannot find enough time to implement OpenAPI v3 support right now. If someone can take a look and implement v3 support, this would be super cool!

@Maillol

This comment has been minimized.

Maillol commented Aug 21, 2018

In v3, the parameters has a 'type', it is in schema key.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameter-object-examples

When I try sphinxcontrib-openapi I will adapt it for my openapi.yml file. And I didn't check if a MR already exists. I also create a pull request: #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment