♻️ Update internal annotation usage for compatibilty with Pydantic 2.11 (#13314)

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
This commit is contained in:
Victorien
2025-02-28 16:15:02 +01:00
committed by GitHub
parent 45e018517b
commit 15dd2b67d3
2 changed files with 26 additions and 4 deletions
+4 -4
View File
@@ -449,15 +449,15 @@ def analyze_param(
# We might check here that `default_value is RequiredParam`, but the fact is that the same
# parameter might sometimes be a path parameter and sometimes not. See
# `tests/test_infer_param_optionality.py` for an example.
field_info = params.Path(annotation=use_annotation)
field_info = params.Path(annotation=type_annotation)
elif is_uploadfile_or_nonable_uploadfile_annotation(
type_annotation
) or is_uploadfile_sequence_annotation(type_annotation):
field_info = params.File(annotation=use_annotation, default=default_value)
field_info = params.File(annotation=type_annotation, default=default_value)
elif not field_annotation_is_scalar(annotation=type_annotation):
field_info = params.Body(annotation=use_annotation, default=default_value)
field_info = params.Body(annotation=type_annotation, default=default_value)
else:
field_info = params.Query(annotation=use_annotation, default=default_value)
field_info = params.Query(annotation=type_annotation, default=default_value)
field = None
# It's a field_info, not a dependency