openapi-core/openapi_core/schema/parameters.py

25 lines
490 B
Python
Raw Normal View History

2021-04-23 11:36:27 +00:00
def get_aslist(param):
return (
param.get('schema', None) and
param['schema']['type'] in ['array', 'object']
)
def get_style(param):
if 'style' in param:
return param['style']
# determine default
return (
'simple' if param['in'] in ['path', 'header'] else 'form'
)
def get_explode(param):
if 'explode' in param:
return param['explode']
2021-04-28 22:17:06 +00:00
# determine default
2021-04-23 11:36:27 +00:00
style = get_style(param)
return style == 'form'