Browse Source

🐛 Fix convert underscores logic for OpenAPI

pull/13515/head
Sebastián Ramírez 2 weeks ago
parent
commit
8c0df783ce
  1. 7
      fastapi/openapi/utils.py

7
fastapi/openapi/utils.py

@ -135,10 +135,15 @@ def _get_openapi_operation_parameters(
separate_input_output_schemas=separate_input_output_schemas, separate_input_output_schemas=separate_input_output_schemas,
) )
name = param.alias name = param.alias
convert_underscores = getattr(
param.field_info,
"convert_underscores",
default_convert_underscores,
)
if ( if (
param_type == ParamTypes.header param_type == ParamTypes.header
and param.alias == param.name and param.alias == param.name
and default_convert_underscores and convert_underscores
): ):
name = param.name.replace("_", "-") name = param.name.replace("_", "-")

Loading…
Cancel
Save