mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-11-25 06:46:25 +00:00
fix: pydantic extra keywords deprecated (#753)
Pydantic deprecates using extra keyword arguments on Field. Used json_schema_extra instead. Deprecated in Pydantic V2.0 to be removed in V3.0. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -23,7 +23,8 @@ class WeatherCommonProviderSettings(SettingsBaseModel):
|
||||
"""Weather Forecast Provider Configuration."""
|
||||
|
||||
WeatherImport: Optional[WeatherImportCommonSettings] = Field(
|
||||
default=None, description="WeatherImport settings", examples=[None]
|
||||
default=None,
|
||||
json_schema_extra={"description": "WeatherImport settings", "examples": [None]},
|
||||
)
|
||||
|
||||
|
||||
@@ -32,19 +33,23 @@ class WeatherCommonSettings(SettingsBaseModel):
|
||||
|
||||
provider: Optional[str] = Field(
|
||||
default=None,
|
||||
description="Weather provider id of provider to be used.",
|
||||
examples=["WeatherImport"],
|
||||
json_schema_extra={
|
||||
"description": "Weather provider id of provider to be used.",
|
||||
"examples": ["WeatherImport"],
|
||||
},
|
||||
)
|
||||
|
||||
provider_settings: WeatherCommonProviderSettings = Field(
|
||||
default_factory=WeatherCommonProviderSettings,
|
||||
description="Provider settings",
|
||||
examples=[
|
||||
# Example 1: Empty/default settings (all providers None)
|
||||
{
|
||||
"WeatherImport": None,
|
||||
},
|
||||
],
|
||||
json_schema_extra={
|
||||
"description": "Provider settings",
|
||||
"examples": [
|
||||
# Example 1: Empty/default settings (all providers None)
|
||||
{
|
||||
"WeatherImport": None,
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
# Validators
|
||||
|
||||
Reference in New Issue
Block a user