A served port omits everything that matches the default
The wire shape is lean by divergence, which means a client cannot read absence as "unknown". Absence is the default, and the defaults are fixed here.
The rule
- A served port emits
defaultValueonly where it is not null,exposedByDefaultonly where it is false, anddisplayOrderonly where it is not 0. - A client must read the absence of those keys as no default, exposed, and order 0 respectively.
What it means
Only the literal value null, false, or 0 counts as "the default", not
anything a caller might read as falsy. A default value of false, an empty
string or an empty list is still a default the author set, and it is
emitted; a display order of a negative number diverges from 0 just as much
as a positive one does, and is emitted too. A client that treats "absent" as
loosely as "falsy" reintroduces exactly the ambiguity the divergence rule
was meant to remove.
Example
A port with none of the three set at all serialises to nothing but the six core keys:
{
"id": "plain",
"name": "Plain",
"type": "input",
"dataType": "string",
"required": false,
"description": ""
}A port whose default is the literal value false still carries the key:
falseAnd a negative display order is emitted the same as a positive one:
-5