diff --git a/demos/python/sdk_wireless_camera_control/open_gopro/models/media_list.py b/demos/python/sdk_wireless_camera_control/open_gopro/models/media_list.py index feda6bb7..e4bf5530 100644 --- a/demos/python/sdk_wireless_camera_control/open_gopro/models/media_list.py +++ b/demos/python/sdk_wireless_camera_control/open_gopro/models/media_list.py @@ -8,7 +8,7 @@ from abc import ABC from typing import Any -from pydantic import Field, PrivateAttr, validator +from pydantic import Field, PrivateAttr, field_validator from open_gopro.models.bases import CustomBaseModel from open_gopro.types import JsonDict @@ -143,7 +143,7 @@ class MediaFileSystem(CustomBaseModel): directory: str = Field(alias="d") # Directory that the files are in file_system: list[MediaItem] = Field(alias="fs") #: List of files - @validator("file_system", pre=True, each_item=True) + @field_validator("file_system", mode="before", check_fields=True) @classmethod def identify_item(cls, item: JsonDict) -> MediaItem: """Extent item into GroupedMediaItem if it such an item