Skip to content

Add support for 'OneOf' in requestBody schemas#54

Closed
mhuin wants to merge 1 commit intosphinx-contrib:masterfrom
softwarefactory-project:auth_scheme_support
Closed

Add support for 'OneOf' in requestBody schemas#54
mhuin wants to merge 1 commit intosphinx-contrib:masterfrom
softwarefactory-project:auth_scheme_support

Conversation

@mhuin
Copy link
Copy Markdown

@mhuin mhuin commented Sep 2, 2019

Compliant with OpenAPI v3.0

Closes #53

openapi_options['examples'] = True
if options.group:
openapi_options['group'] = True
# openapi_options['request'] = True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this? A leftover?

elif secScheme['type'] == 'apiKey':
key_loc = secScheme['in']
yield ('{indent}:security: '
'API key in {key_loc}').format(**locals())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also print secScheme['name']. Otherwise, it's not clear in which header to look in.

for ref in security.keys():
secScheme = components.get('securitySchemes', {}).get(ref, {})
if secScheme['type'] == 'http':
if secScheme['scheme'] == 'basic':
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

yield '{indent}{line}'.format(**locals())
yield ''

securities = properties.get('security', [])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.. I wonder, is it a good idea to render every possible body input? 🤔 Can you please add tests?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just seeing your reviews now, I'll address them ASAP!

@mhuin mhuin force-pushed the auth_scheme_support branch from 7d5a8c5 to 17a6df5 Compare October 3, 2019 10:46
@mhuin
Copy link
Copy Markdown
Author

mhuin commented Nov 20, 2019

Hello,
Anything else I need to do to get this merged?
Thanks!

@stephenfin
Copy link
Copy Markdown
Member

Done via #143

@stephenfin stephenfin closed this Oct 26, 2023
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

Successfully merging this pull request may close these issues.

OpenAPI v3: RequestBody should support OneOf, AnyOf

3 participants