Bases: CustomField
A class that represents a custom field without casting.
You can use it to annotate fields, that should not be casted.
Usage:
data: Annotated[..., NoCast()]
Source code in faststream/utils/no_cast.py
| def __init__(self) -> None:
super().__init__(cast=False)
|
param_name instance-attribute
required instance-attribute
set_param_name
Source code in fast_depends/library/model.py
| def set_param_name(self: Cls, name: str) -> Cls:
self.param_name = name
return self
|
use_field
Source code in fast_depends/library/model.py
| def use_field(self, kwargs: Dict[str, Any]) -> None:
raise NotImplementedError("You should implement `use_field` method.")
|
use
Source code in faststream/utils/no_cast.py
| def use(self, **kwargs: Any) -> AnyDict:
return kwargs
|