# HG changeset patch # User Chris Cannam # Date 1475657929 -3600 # Node ID ada4cd9daaba46bc2046bab5d891c3e3fd1f1f49 # Parent 98930c9d54fae1acd493b5ff2f8f0717b345a141 Pull out serialisedarray schema diff -r 98930c9d54fa -r ada4cd9daaba examples/serialisedarray-array.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/serialisedarray-array.json Wed Oct 05 09:58:49 2016 +0100 @@ -0,0 +1,1 @@ +[1,2,-3,3.1415926537] diff -r 98930c9d54fa -r ada4cd9daaba examples/serialisedarray-base64.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/serialisedarray-base64.json Wed Oct 05 09:58:49 2016 +0100 @@ -0,0 +1,1 @@ +"AACAPwAAAEAEAEBAAACAQAAAoEAAAMBAAADQQAAA4EA" diff -r 98930c9d54fa -r ada4cd9daaba schema/feature.json --- a/schema/feature.json Wed Oct 05 09:42:26 2016 +0100 +++ b/schema/feature.json Wed Oct 05 09:58:49 2016 +0100 @@ -14,27 +14,10 @@ "type": "string" }, "featureValues": { - "$ref": "#/definitions/serialisedArray" + "$ref": "http://vamp-plugins.org/json/schema/serialisedarray#" } }, - "additionalProperties": false, - "definitions": { - "serialisedArray": { - "anyOf": [ - { - "type": "array", - "items": { "type": "number" } - }, - { - "type": "string", - "media": { - "binaryEncoding": "base64", - "type": "application/octet-stream" - }, - } - ] - } - } + "additionalProperties": false } diff -r 98930c9d54fa -r ada4cd9daaba schema/processinput.json --- a/schema/processinput.json Wed Oct 05 09:42:26 2016 +0100 +++ b/schema/processinput.json Wed Oct 05 09:58:49 2016 +0100 @@ -10,28 +10,11 @@ "inputBuffers": { "type": "array", "items": { - "$ref": "#/definitions/serialisedArray" + "$ref": "http://vamp-plugins.org/json/schema/serialisedarray#" } } }, - "additionalProperties": false, - "definitions": { - "serialisedArray": { - "anyOf": [ - { - "type": "array", - "items": { "type": "number" } - }, - { - "type": "string", - "media": { - "binaryEncoding": "base64", - "type": "application/octet-stream" - } - } - ] - } - } + "additionalProperties": false } diff -r 98930c9d54fa -r ada4cd9daaba schema/serialisedarray.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/serialisedarray.json Wed Oct 05 09:58:49 2016 +0100 @@ -0,0 +1,20 @@ +{ + "id": "http://vamp-plugins.org/json/schema/serialisedarray#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "schema for alternate serialisations of an array of floating-point values", + "anyOf": [ + { + "type": "array", + "items": { "type": "number" } + }, + { + "type": "string", + "media": { + "binaryEncoding": "base64", + "type": "application/octet-stream" + } + } + ] +} + + diff -r 98930c9d54fa -r ada4cd9daaba test.sh --- a/test.sh Wed Oct 05 09:42:26 2016 +0100 +++ b/test.sh Wed Oct 05 09:58:49 2016 +0100 @@ -1,6 +1,5 @@ #!/bin/bash -set -eu for ex in examples/*.json ; do echo "Checking $ex..." 1>&2