Pydantic · Type Alias
SecretBytes
SecretStr and SecretBytes wrap sensitive strings and bytes. They hide the value in normal output and JSON, while get_secret_value() provides explicit access to the original.
Last updated
Syntax
class Model(BaseModel):
password: SecretStr
token: SecretBytesIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
SecretStrSecretBytesget_secret_valueBaseModelfield_serializer