17 lines
359 B
Python
17 lines
359 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import asdict, dataclass, field
|
|
from typing import Any
|
|
|
|
|
|
@dataclass
|
|
class Diagnostic:
|
|
code: str
|
|
message: str
|
|
severity: str = "error"
|
|
feature_id: str | None = None
|
|
detail: dict[str, Any] = field(default_factory=dict)
|
|
|
|
def as_dict(self) -> dict[str, Any]:
|
|
return asdict(self)
|