Function entity_to_value

Source
pub fn entity_to_value(defn: &EntityDef) -> Value
Expand description

Convert a SDML EntityDef into a context object, in the form shown as JSON below.

{
    "__type": "entity",
    "source_span": {},              // optional
    "name": "Identifier",
    "identity": {},
    "annotations": [],              // optional
    "members": []                   // optional
}

For identity, see MemberDef and for members see Member, in member_to_value.