Skip to content

Commit

Permalink
Merge pull request #95 from noflo/schema_support
Browse files Browse the repository at this point in the history
Schema support
  • Loading branch information
bergie committed Sep 19, 2017
2 parents 3f71486 + aa06678 commit 5b4a086
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/protocol/Component.coffee
Expand Up @@ -106,6 +106,7 @@ class ComponentProtocol
inPorts.push
id: portName
type: port.getDataType() if port.getDataType
schema: port.getSchema() if port.getSchema
required: port.isRequired() if port.isRequired
addressable: port.isAddressable() if port.isAddressable
description: port.getDescription() if port.getDescription
Expand All @@ -116,6 +117,7 @@ class ComponentProtocol
outPorts.push
id: portName
type: port.getDataType() if port.getDataType
schema: port.getSchema() if port.getSchema
required: port.isRequired() if port.isRequired
addressable: port.isAddressable() if port.isAddressable
description: port.getDescription() if port.getDescription
Expand Down
6 changes: 6 additions & 0 deletions src/protocol/Network.coffee
Expand Up @@ -17,6 +17,10 @@ prepareSocketEvent = (event, req) ->
payload.subgraph = event.subgraph
if event.group
payload.group = event.group
if event.datatype
payload.type = event.datatype
if event.schema
payload.schema = event.schema
if typeof event.data isnt 'undefined'
unless noflo.isBrowser()
if Buffer.isBuffer event.data
Expand Down Expand Up @@ -179,6 +183,8 @@ class NetworkProtocol extends EventEmitter
when 'data'
protocolEvent.type = 'data'
protocolEvent.data = event.data
protocolEvent.datatype = event.datatype
protocolEvent.schema = event.schema
when 'closeBracket'
protocolEvent.type = 'endgroup'
protocolEvent.group = event.data
Expand Down
1 change: 1 addition & 0 deletions src/protocol/Runtime.coffee
Expand Up @@ -36,6 +36,7 @@ portToPayload = (pub, internal, network, inPort) ->
# we don't have full component info
return def unless port
def.type = port.getDataType()
def.schema = port.getSchema() if port.getSchema
def.description = internal.metadata?.description or port.getDescription()
def.addressable = port.isAddressable()
def.required = port.isRequired()
Expand Down

0 comments on commit 5b4a086

Please sign in to comment.