bundles / papyri latest / papyri / node_serializer
module
papyri.node_serializer
source: /papyri/node_serializer.py :0
Members
Summary
Internally-tagged Node -> dict serializer.
Extended Summary
Unlike serde (which tags unions externally, i.e. wraps each value in {"type": ..., "data": ...}), this serializer folds the tag into the value itself: every serialized Node dict carries a "type" key alongside its regular fields. The tag is either the class's type class-attribute (if set, e.g. "inlineCode") or the class name.
Used by Node.to_dict / Node.to_json.
Additional content
Internally-tagged Node -> dict serializer.
Unlike serde (which tags unions externally, i.e. wraps each value in {"type": ..., "data": ...}), this serializer folds the tag into the value itself: every serialized Node dict carries a "type" key alongside its regular fields. The tag is either the class's type class-attribute (if set, e.g. "inlineCode") or the class name.
Used by Node.to_dict / Node.to_json.
Aliases
-
papyri.node_serializer