No edge key is structurally required
The rule
Normative: this is the rule
- An edge MUST be accepted structurally whatever members it carries.
- An absent source, target or handle MUST stay absent: an implementation MUST NOT fill it with the empty string or
nullwhen it reads, stores or returns the edge. - An absent collection MUST default to the empty array.
- An edge without a source or a target MUST NOT be refused as a parse failure.
- Validation MUST refuse it as an edge missing its source or target, so an author is told what is wrong with the wire rather than that the document could not be read.
Why
Fixtures
Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.
An edge with no handles reads back with no handles read-edge
Not the empty string, not null.
{ "given": { "edge": { "source": "n1", "target": "n2" } }, "expect": { "edge": { "source": "n1", "target": "n2" } } }An edge's handles read back as sent read-edge
{ "given": { "edge": { "source": "n1", "target": "n2", "sourceHandle": "n1-output-text", "targetHandle": "n2-input-prompt" } }, "expect": { "edge": { "source": "n1", "target": "n2", "sourceHandle": "n1-output-text", "targetHandle": "n2-input-prompt" } } }
Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · EDGE-2 · changed in spec 1.0