From 71b88c1e029862b954c5a02a7ce1620fae078dfc Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Fri, 3 Nov 2023 10:35:27 -0500 Subject: [PATCH] force channels json to validate against both column descriptions and stricter level object. --- .../validators/json/schemas/channels.json | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/bids-validator/validators/json/schemas/channels.json b/bids-validator/validators/json/schemas/channels.json index e6e32f947..9ea8fcdac 100644 --- a/bids-validator/validators/json/schemas/channels.json +++ b/bids-validator/validators/json/schemas/channels.json @@ -1,36 +1,35 @@ { "$schema": "http://json-schema.org/draft-06/schema#", - "type": "object", - "properties": { - "reference_frame": { - "$ref": "common_definitions.json#/definitions/ColumnDescription", - "title": "Reference Frame", + "allOf": [ + { + "type": "object", "properties": { - "$ref": "common_definitions.json#/definitions/ColumnDescription/properties", - "Levels": { - "$ref": "common_definitions.json#/definitions/ColumnDescription/properties/Levels", + "reference_frame": { + "title": "Reference Frame", "properties": { - "RotationOrder": { - "description": "The sequence in which the extrinsic rotations are applied around the three axes.", - "type": "string", - "enum": ["XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"] - }, - "RotationRule": { - "description": "The direction of rotation around each axis.", - "type": "string", - "enum": ["left-hand", "right-hand"] - }, - "SpatialAxes": { - "description": "The coordinate system in which the motion data are to be interpreted. A sequence of characters from the set `{'A', 'P', 'L', 'R', 'S', 'I', '_'}` indicating the direction of each axis. For example `\"ARS\"` indicates positive values in the X, Y, Z axes are respectively anterior, right, and superior of the origin, while `\"PLI\"` indicates positive values are posterior, left, and inferior of the origin. The `\"_\"` character may be used for unused axes.", - "type": "string", - "pattern": "^[APLRSI_]{3}$" + "Levels": { + "properties": { + "RotationOrder": { + "description": "The sequence in which the extrinsic rotations are applied around the three axes.", + "type": "string", + "enum": ["XYZ", "XZY", "YXZ", "YZX", "ZXY", "ZYX"] + }, + "RotationRule": { + "description": "The direction of rotation around each axis.", + "type": "string", + "enum": ["left-hand", "right-hand"] + }, + "SpatialAxes": { + "description": "The coordinate system in which the motion data are to be interpreted. A sequence of characters from the set `{'A', 'P', 'L', 'R', 'S', 'I', '_'}` indicating the direction of each axis. For example `\"ARS\"` indicates positive values in the X, Y, Z axes are respectively anterior, right, and superior of the origin, while `\"PLI\"` indicates positive values are posterior, left, and inferior of the origin. The `\"_\"` character may be used for unused axes.", + "type": "string", + "pattern": "^[APLRSI_]{3}$" + } + } } } } } - } - }, - "patternProperties": { - "^.+$": { "$ref": "common_definitions.json#/definitions/ColumnDescription" } - } + }, + { "$ref": "common_definitions.json#/definitions/ColumnDescription" } + ] }