From 42c5dbf46982c6e1cdccc34092b346ba2a944312 Mon Sep 17 00:00:00 2001 From: Denis Anikin Date: Mon, 8 Jan 2024 04:55:32 +0300 Subject: [PATCH] Fixed trash things --- scripts/__main__.py | 2 +- whole_app/models.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/__main__.py b/scripts/__main__.py index a187b79..ab5f741 100755 --- a/scripts/__main__.py +++ b/scripts/__main__.py @@ -46,7 +46,7 @@ def _update_readme() -> None: if field_properties.metadata: validators_buf: list[str] = [] for one_obj in field_properties.metadata: - restriction_stringified: typing.Final = str(one_obj) + restriction_stringified: str = str(one_obj) if any(("BeforeValidator" in restriction_stringified, "StringConstraints" in restriction_stringified)): continue validators_buf.append(f"`{restriction_stringified}`") diff --git a/whole_app/models.py b/whole_app/models.py index 69c197b..5deac1b 100644 --- a/whole_app/models.py +++ b/whole_app/models.py @@ -15,11 +15,11 @@ class OneCorrection(pydantic.BaseModel): class SpellCheckRequest(pydantic.BaseModel): - text: str = pydantic.Field(..., example="Привед как дила") + text: str = pydantic.Field(..., examples=["Привед как дила"]) language: AvailableLanguagesType user_name: str | None = pydantic.Field( None, - example="username", + examples=["username"], pattern=SETTINGS.username_regex, min_length=SETTINGS.username_min_length, max_length=SETTINGS.username_max_length, @@ -34,7 +34,7 @@ class SpellCheckResponse(pydantic.BaseModel): class UserDictionaryRequest(pydantic.BaseModel): user_name: str = pydantic.Field( - example="username", + examples=["username"], pattern=SETTINGS.username_regex, min_length=SETTINGS.username_min_length, max_length=SETTINGS.username_max_length, @@ -42,7 +42,7 @@ class UserDictionaryRequest(pydantic.BaseModel): class UserDictionaryRequestWithWord(UserDictionaryRequest): - exception_word: str = pydantic.Field(..., example="привед") + exception_word: str = pydantic.Field(..., examples=["привед"]) class HealthCheckResponse(pydantic.BaseModel):