You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@DataClass(frozen=True)
class ChapterShortKey:
open: str = field(default="shift+alt+o")
class ConfigApps(BaseConfig):
websockets: ChapterWebSockets
shortkey: ChapterShortKey`
выдаёт ошибку pydantic_core._pydantic_core.ValidationError: 2 validation errors for ConfigApps websockets Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/missing shortkey Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/missing
как сделать чтобы использовал их значения по умолчанию
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
`from dataclasses import field
from pydantic.dataclasses import dataclass
from pydantic import Field, field_validator
from .commonConfig import Ports, BaseConfig
@DataClass(frozen=True)
class ChapterWebSockets:
IN: Ports = field(default=Ports(8000, 8010))
OUT: Ports = field(default=Ports(8015, 8020))
@DataClass(frozen=True)
class ChapterShortKey:
open: str = field(default="shift+alt+o")
class ConfigApps(BaseConfig):
websockets: ChapterWebSockets
shortkey: ChapterShortKey`
выдаёт ошибку
pydantic_core._pydantic_core.ValidationError: 2 validation errors for ConfigApps websockets Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/missing shortkey Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.11/v/missing
как сделать чтобы использовал их значения по умолчанию
Beta Was this translation helpful? Give feedback.
All reactions