You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With OpenAPI 3 and up the path arguments have to be inside a schema to be recognized. In paths.py argument_to_param the 'type', 'format', and 'default' are all just put in the param dictionary to fix this the spec version could be passed to argument_to_param and if it is >= 3 then put the previously mentioned values inside a schema dictionary inside of params. I'm sure there is a better fix but something like this would suffice:
def argument_to_param(argument, rule, spec_version, override=None):
param = {
'in': 'path',
'name': argument,
'required': True,
}
type_, format_ = CONVERTER_MAPPING.get(type(rule._converters[argument]), DEFAULT_TYPE)
if spec_version < 3:
param['type'] = type_
if format_ is not None:
param['format'] = format_
if rule.defaults and argument in rule.defaults:
param['default'] = rule.defaults[argument]
else:
param['schema'] = {}
param['schema']['type'] = type_
if format_ is not None:
param['schema']['format'] = format_
if rule.defaults and argument in rule.defaults:
param['schema']['default'] = rule.defaults[argument]
param.update(override or {})
return param
The text was updated successfully, but these errors were encountered:
With OpenAPI 3 and up the path arguments have to be inside a schema to be recognized. In paths.py argument_to_param the 'type', 'format', and 'default' are all just put in the param dictionary to fix this the spec version could be passed to argument_to_param and if it is >= 3 then put the previously mentioned values inside a schema dictionary inside of params. I'm sure there is a better fix but something like this would suffice:
The text was updated successfully, but these errors were encountered: