From 4ec2131be5cc7cb0bfe67387092a26458e06fff5 Mon Sep 17 00:00:00 2001 From: Lasse Gravesen Date: Fri, 24 Apr 2020 16:22:41 +0200 Subject: [PATCH] fix: fix pr comments. --- changes/1424-atheuz.md | 2 +- pydantic/types.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/changes/1424-atheuz.md b/changes/1424-atheuz.md index d02af90e26d..1b955c62cb1 100644 --- a/changes/1424-atheuz.md +++ b/changes/1424-atheuz.md @@ -1 +1 @@ -include format with secret types #546 \ No newline at end of file +include `format` with secret types \ No newline at end of file diff --git a/pydantic/types.py b/pydantic/types.py index e9247de53d3..01b300734e7 100644 --- a/pydantic/types.py +++ b/pydantic/types.py @@ -530,8 +530,7 @@ def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: class SecretStr: @classmethod def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: - field_schema.update(type='string', writeOnly=True) - field_schema.update(type='string', format='password') + field_schema.update(type='string', writeOnly=True, format='password') @classmethod def __get_validators__(cls) -> 'CallableGenerator': @@ -567,8 +566,7 @@ def get_secret_value(self) -> str: class SecretBytes: @classmethod def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: - field_schema.update(type='string', writeOnly=True) - field_schema.update(type='string', format='password') + field_schema.update(type='string', writeOnly=True, format='password') @classmethod def __get_validators__(cls) -> 'CallableGenerator':