[ { "description": "Masking Properties", "schema": { "$id": "mask_properties", "type": "object", "properties": { "foo": { "type": "string" }, "bar": { "type": "integer" } }, "required": [ "foo" ], "extensible": false }, "tests": [ { "description": "Keep valid properties", "data": { "foo": "a", "bar": 1 }, "valid": true, "expected": { "foo": "a", "bar": 1 } }, { "description": "Remove unknown properties", "data": { "foo": "a", "baz": true }, "valid": true, "expected": { "foo": "a" } }, { "description": "Keep valid properties with unknown", "data": { "foo": "a", "bar": 1, "baz": true }, "valid": true, "expected": { "foo": "a", "bar": 1 } } ] }, { "description": "Masking Nested Objects", "schema": { "$id": "mask_nested", "type": "object", "properties": { "meta": { "type": "object", "properties": { "id": { "type": "integer" } }, "extensible": false } }, "extensible": false }, "tests": [ { "description": "Mask nested object", "data": { "meta": { "id": 1, "extra": "x" }, "top_extra": "y" }, "valid": true, "expected": { "meta": { "id": 1 } } } ] }, { "description": "Masking Arrays", "schema": { "$id": "mask_arrays", "type": "object", "properties": { "tags": { "type": "array", "items": { "type": "string" } } }, "extensible": false }, "tests": [ { "description": "Arrays are kept (items are valid)", "data": { "tags": [ "a", "b" ] }, "valid": true, "expected": { "tags": [ "a", "b" ] } } ] }, { "description": "Masking Tuple Arrays (prefixItems)", "schema": { "$id": "mask_tuple", "type": "object", "properties": { "coord": { "type": "array", "prefixItems": [ { "type": "number" }, { "type": "number" } ] } }, "extensible": false }, "tests": [ { "description": "Extra tuple items removed", "data": { "coord": [ 1, 2, 3, "extra" ] }, "valid": true, "expected": { "coord": [ 1, 2 ] } } ] } ]