arch-design-agent-skill-das.../backend/app/modules/scanner/infrastructure/parsers/yaml_parser.py
openclaw 699e2ad919 feat(scanner): add YAML and OpenAPI parsers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 16:32:11 +00:00

20 lines
482 B
Python

"""YAML parser — simple wrapper around yaml.safe_load for configuration files."""
from __future__ import annotations
from pathlib import Path
from typing import Any
import yaml
class YamlParser:
"""Load a YAML file and return its contents as a Python dict/list."""
def load(self, file_path: Path) -> Any:
try:
with open(file_path, encoding="utf-8") as f:
return yaml.safe_load(f)
except Exception:
return None