Add support for 'OneOf' in requestBody schemas#54
Add support for 'OneOf' in requestBody schemas#54mhuin wants to merge 1 commit intosphinx-contrib:masterfrom
Conversation
sphinxcontrib/openapi/__main__.py
Outdated
| openapi_options['examples'] = True | ||
| if options.group: | ||
| openapi_options['group'] = True | ||
| # openapi_options['request'] = True |
sphinxcontrib/openapi/openapi30.py
Outdated
| elif secScheme['type'] == 'apiKey': | ||
| key_loc = secScheme['in'] | ||
| yield ('{indent}:security: ' | ||
| 'API key in {key_loc}').format(**locals()) |
There was a problem hiding this comment.
I think we should also print secScheme['name']. Otherwise, it's not clear in which header to look in.
sphinxcontrib/openapi/openapi30.py
Outdated
| for ref in security.keys(): | ||
| secScheme = components.get('securitySchemes', {}).get(ref, {}) | ||
| if secScheme['type'] == 'http': | ||
| if secScheme['scheme'] == 'basic': |
There was a problem hiding this comment.
If I'm not mistaken, secScheme['scheme'] is case insensitive. Can you please.lower() it before comparison? Otherwise, it won't work for specs with Basic spelling and that's something I'd like to address.
sphinxcontrib/openapi/openapi30.py
Outdated
| yield '{indent}{line}'.format(**locals()) | ||
| yield '' | ||
|
|
||
| securities = properties.get('security', []) |
There was a problem hiding this comment.
It does not look like a oneOf support. Can you please move security schemes support to separate PR?
| yield '{indent}{indent}{line}'.format(**locals()) | ||
| # yield '' | ||
| schs = [] | ||
| if 'oneOf' in schema: |
There was a problem hiding this comment.
Hm.. I wonder, is it a good idea to render every possible body input? 🤔 Can you please add tests?
There was a problem hiding this comment.
Sorry, just seeing your reviews now, I'll address them ASAP!
Compliant with OpenAPI v3.0
7d5a8c5 to
17a6df5
Compare
|
Hello, |
|
Done via #143 |
Compliant with OpenAPI v3.0
Closes #53