Skip to content

Commit f259243

Browse files
committed
feat: auto convert to LDContext
1 parent de2dba7 commit f259243

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/apmodel/loader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from dataclasses import fields
22

3+
from .context import LDContext
4+
35
from .types import ActivityPubModel
46
from .core import (
57
Object,
@@ -146,7 +148,7 @@ def load(data: dict) -> dict | ActivityPubModel:
146148
known_fields = {f.name for f in fields(cls)}
147149
for key, value in data.items():
148150
if key == "@context":
149-
kwargs["_context"] = value
151+
kwargs["_context"] = LDContext(value)
150152
elif key in known_fields:
151153
if isinstance(value, dict):
152154
kwargs[key] = load(value)

0 commit comments

Comments
 (0)