Load configuration from a JSON file.
(cls, json_path: str)
| 42 | |
| 43 | @classmethod |
| 44 | def from_json_file(cls, json_path: str) -> Any: |
| 45 | """Load configuration from a JSON file.""" |
| 46 | with open(json_path, encoding="utf-8") as f: |
| 47 | data = f.read() |
| 48 | return cls.model_validate_json(data) |
| 49 | |
| 50 | def to_json_file(self, json_path: str) -> None: |
| 51 | """Dump configuration to a JSON file.""" |