A dynamic port declares a name, a label and a data type
The rule
- Every dynamic port definition MUST carry a
nameand alabel. - It can carry
exposedByDefault, a boolean, the default exposure of the port it adds, read as a node type's is (EXPO-2, CFG-2). - A dynamic parameter definition can also carry the gate flags
connectable,configurableandrequired, which mean what they mean on a declared parameter and default as they do there (CFG-1). - Any definition can carry a
schema, a JSON Schema 2020-12 fragment of the same kind a node type's declared parameter and output schemas hold, and it can carry adataType. - Where
schemais present it is the port's schema, its lane derives from it as any property's does (SCH-10), anddataTypeMUST be ignored. - Where
schemais absent,dataTypeis the port's lane, and a definition with neither MUST be read asmixed. - An authoring surface MUST NOT produce a definition whose lane is a control lane, because a dynamic port carries a value by definition.
What it means
A dynamic port definition has a name and a label, and says what the port
carries in one of two ways. A dataType names a lane, and the port gets the
JSON Schema type that lane stands for (DYN-8). A schema describes the port
fully, with anything a node type's own port schemas can say, and then it is
the port: its lane comes from it the way any property's does. With neither,
the port is mixed and accepts any value.
Because a schema can say everything a node type can, an author can describe
a node's ports without any processor declaring them, wire a workflow against
them, and later switch the node to a processor that declares the same ports.
A dynamic parameter also says what kind of parameter it is, with the same gate
flags a declared one carries: connectable makes it an input a wire can feed,
configurable makes it a setting the author fills in, and both together give a
setting a wire can override. Like any parameter, a flag left out is off.
An authoring surface never records a control lane for a dynamic port: a dynamic port is a value port by definition.
Example
[
{ "name": "topic", "label": "Topic", "dataType": "string", "connectable": true,
"exposedByDefault": true },
{ "name": "limit", "label": "Limit", "configurable": true, "exposedByDefault": false,
"schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } }
]topic is an input that accepts any string. limit is a setting in the node's
config form, accepts an integer from 1 to 50, and is 10 until the author changes
it.