# HG changeset patch # User Chris Cannam # Date 1474985009 -3600 # Node ID a444a851bd679600fc0fe95505dd108fde7c7caa # Parent 60c53d43a32b32d72e920b13d668e186d79a8ed3 Instead of using separate values and b64values entries, allow numeric arrays to be replaced by b64 variants wherever they appear (discriminating by type). Also rename values to featureValues in feature, as values turns out to be a hazardous name in a JS context diff -r 60c53d43a32b -r a444a851bd67 examples/feature.json --- a/examples/feature.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/feature.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}} +{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}} diff -r 60c53d43a32b -r a444a851bd67 examples/featureset.json --- a/examples/featureset.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/featureset.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"outputid": [{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]} +{"outputid": [{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]} diff -r 60c53d43a32b -r a444a851bd67 examples/processinput.json --- a/examples/processinput.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processinput.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"inputBuffers":[{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"}], "timestamp": {"n": 141590000, "s": 3}} +{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}} diff -r 60c53d43a32b -r a444a851bd67 examples/processrequest.json --- a/examples/processrequest.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processrequest.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,1 +1,1 @@ -{"pluginHandle":12345,"processInput":{"inputBuffers":[{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"}], "timestamp": {"n": 141590000, "s": 3}}} +{"pluginHandle":12345,"processInput":{"inputBuffers":["AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA"], "timestamp": {"n": 141590000, "s": 3}}} diff -r 60c53d43a32b -r a444a851bd67 examples/processresponse.json --- a/examples/processresponse.json Tue Sep 27 11:19:19 2016 +0100 +++ b/examples/processresponse.json Tue Sep 27 15:03:29 2016 +0100 @@ -1,2 +1,2 @@ -{"pluginHandle":12345,"features":{"outputid": [{"b64values": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]}} +{"pluginHandle":12345,"features":{"outputid": [{"featureValues": "AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA", "label": "A feature", "timestamp": {"n": 141590000, "s": 3}}]}} diff -r 60c53d43a32b -r a444a851bd67 schema/feature.json --- a/schema/feature.json Tue Sep 27 11:19:19 2016 +0100 +++ b/schema/feature.json Tue Sep 27 15:03:29 2016 +0100 @@ -13,12 +13,17 @@ "label": { "type": "string" }, - "values": { - "type": "array", - "items": { "type": "number" } - }, - "b64values": { - "type": "string" + "featureValues": { + "anyOf": [ + { + "type": "array", + "items": { "type": "number" } + }, + { + "type": "string", + "pattern": "^[a-zA-Z0-9+/]*=*$" + } + ] } }, "additionalProperties": false diff -r 60c53d43a32b -r a444a851bd67 schema/processinput.json --- a/schema/processinput.json Tue Sep 27 11:19:19 2016 +0100 +++ b/schema/processinput.json Tue Sep 27 15:03:29 2016 +0100 @@ -10,16 +10,16 @@ "inputBuffers": { "type": "array", "items": { - "type": "object", - "properties": { - "values": { + "anyOf": [ + { "type": "array", "items": { "type": "number" } }, - "b64values": { - "type": "string" + { + "type": "string", + "pattern": "^[a-zA-Z0-9+/]*=*$" } - } + ] } } },