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:
Bobby Noelte
2025-11-10 16:57:44 +01:00
committed by GitHub
parent 54b0622a96
commit e7b43782a4
44 changed files with 1956 additions and 1194 deletions

View File

@@ -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