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

@@ -22,14 +22,18 @@ class PVForecastImportCommonSettings(SettingsBaseModel):
import_file_path: Optional[Union[str, Path]] = Field(
default=None,
description="Path to the file to import PV forecast data from.",
examples=[None, "/path/to/pvforecast.json"],
json_schema_extra={
"description": "Path to the file to import PV forecast data from.",
"examples": [None, "/path/to/pvforecast.json"],
},
)
import_json: Optional[str] = Field(
default=None,
description="JSON string, dictionary of PV forecast value lists.",
examples=['{"pvforecast_ac_power": [0, 8.05, 352.91]}'],
json_schema_extra={
"description": "JSON string, dictionary of PV forecast value lists.",
"examples": ['{"pvforecast_ac_power": [0, 8.05, 352.91]}'],
},
)
# Validators