MCPcopy Index your code
hub / github.com/fastapi/fastapi / _validate_value_with_model_field

Function _validate_value_with_model_field

fastapi/dependencies/utils.py:738–746  ·  view source on GitHub ↗
(
    *, field: ModelField, value: Any, values: dict[str, Any], loc: tuple[str, ...]
)

Source from the content-addressed store, hash-verified

736
737
738def _validate_value_with_model_field(
739 *, field: ModelField, value: Any, values: dict[str, Any], loc: tuple[str, ...]
740) -> tuple[Any, list[Any]]:
741 if value is None:
742 if field.field_info.is_required():
743 return None, [get_missing_field_error(loc=loc)]
744 else:
745 return deepcopy(field.default), []
746 return field.validate(value, values, loc=loc)
747
748
749def _is_json_field(field: ModelField) -> bool:

Callers 2

request_params_to_argsFunction · 0.85
request_body_to_argsFunction · 0.85

Calls 2

get_missing_field_errorFunction · 0.90
validateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…