Skip to content

Commit fb4a389

Browse files
committed
Change for newer pydantic.
1 parent acd1f49 commit fb4a389

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/lib/freee_a11y_gl/src/freee_a11y_gl/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Any, Dict, Optional, List, Literal
66
import yaml
7-
from pydantic import BaseModel, Field, validator
7+
from pydantic import BaseModel, Field, field_validator
88

99
class LocaleConfig(BaseModel):
1010
"""Locale-specific configuration."""
@@ -28,7 +28,8 @@ class PathConfig(BaseModel):
2828
guidelines: str = Field(default="/categories/", description="Guidelines path (must start and end with /)")
2929
faq: str = Field(default="/faq/articles/", description="FAQ path (must start and end with /)")
3030

31-
@validator("guidelines", "faq")
31+
@field_validator("guidelines", "faq")
32+
@classmethod
3233
def validate_path(cls, v: str) -> str:
3334
"""Validate path string.
3435
@@ -163,7 +164,7 @@ def __init__(self):
163164
def load_defaults(self) -> None:
164165
"""デフォルト設定の読み込み"""
165166
# Pydanticモデルのデフォルト値を使用
166-
self._settings = GlobalConfig().dict()
167+
self._settings = GlobalConfig().model_dump()
167168

168169
def _get_config_search_paths(self) -> List[Path]:
169170
"""Get list of paths to search for config files.

0 commit comments

Comments
 (0)