Skip to content

Commit

Permalink
fix: Pydantic V1 style @validator validators are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
martincarapia committed Jan 8, 2025
1 parent 719f738 commit 1934486
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1934486

Please sign in to comment.