diff --git a/encoding/jsonschema/external_test.go b/encoding/jsonschema/external_test.go index 414b30434..aafbfcb9f 100644 --- a/encoding/jsonschema/external_test.go +++ b/encoding/jsonschema/external_test.go @@ -137,7 +137,7 @@ func runExternalSchemaTests(t *testing.T, m *cuetdtest.M, filename string, s *ex instValue := ctx.BuildExpr(instAST) qt.Assert(t, qt.IsNil(instValue.Err())) - err = instValue.Unify(schemaValue).Err() + err = instValue.Unify(schemaValue).Validate(cue.Concrete(true)) if test.Valid { if err != nil { testFailed(t, m, &test.Skip, test, errors.Details(err, nil)) diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/allOf.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/allOf.json index b3dfcd7bc..963335588 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/allOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/allOf.json @@ -40,22 +40,14 @@ "data": { "foo": "baz" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "wrong type", @@ -118,11 +110,7 @@ "foo": "quux", "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first allOf", @@ -130,11 +118,7 @@ "bar": 2, "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch second allOf", @@ -142,22 +126,14 @@ "foo": "quux", "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch both", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/anyOf.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/anyOf.json index 90c2952f8..a3c6b724e 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/anyOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/anyOf.json @@ -159,14 +159,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second anyOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both anyOf valid (complex)", diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/enum.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/enum.json index 72b200888..81a839dfc 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/enum.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/enum.json @@ -160,20 +160,12 @@ "data": { "foo": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "missing all properties is invalid", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/items.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/items.json index 53a8147a6..0aecf2b79 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/items.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/items.json @@ -417,11 +417,7 @@ } ] ], - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "fewer items is valid", @@ -439,7 +435,7 @@ ], "valid": true, "skip": { - "v2": "incompatible list lengths (2 and 3)\n", + "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n" } } diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/oneOf.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/oneOf.json index de5c86877..642adb01a 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/oneOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/oneOf.json @@ -192,14 +192,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second oneOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both oneOf valid (complex)", @@ -277,11 +285,7 @@ "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "first valid - valid", @@ -289,7 +293,11 @@ "foo": 1, "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n", + "v3": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n" + } }, { "description": "second valid - valid", @@ -297,7 +305,11 @@ "foo": 1, "baz": 3 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n", + "v3": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n" + } }, { "description": "both valid - invalid", @@ -344,14 +356,22 @@ "data": { "bar": 8 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n", + "v3": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n" + } }, { "description": "second oneOf valid", "data": { "foo": "foo" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n", + "v3": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n" + } }, { "description": "both oneOf valid", @@ -359,22 +379,14 @@ "foo": "foo", "bar": 8 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "neither oneOf valid", "data": { "baz": "quux" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/required.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/required.json index 13e5021a7..7d5ba85cb 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/required.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/required.json @@ -24,11 +24,7 @@ "data": { "bar": 1 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "ignores arrays", @@ -112,11 +108,7 @@ "foo\nbar": "1", "foo\"bar": "1" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, @@ -145,22 +137,14 @@ { "description": "none of the properties mentioned", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "__proto__ present", "data": { "__proto__": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "toString present", @@ -169,11 +153,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "constructor present", @@ -182,11 +162,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "all present", diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/allOf.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/allOf.json index 4c6e2a8c2..78bf421f9 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/allOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/allOf.json @@ -40,22 +40,14 @@ "data": { "foo": "baz" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "wrong type", @@ -118,11 +110,7 @@ "foo": "quux", "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first allOf", @@ -130,11 +118,7 @@ "bar": 2, "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch second allOf", @@ -142,22 +126,14 @@ "foo": "quux", "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch both", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/anyOf.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/anyOf.json index 13366e06b..d6d22394d 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/anyOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/anyOf.json @@ -159,14 +159,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second anyOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both anyOf valid (complex)", diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/enum.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/enum.json index eacda647e..d1ba557ae 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/enum.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/enum.json @@ -160,20 +160,12 @@ "data": { "foo": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "missing all properties is invalid", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/oneOf.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/oneOf.json index 36d38bc8a..9b0d8f5c1 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/oneOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/oneOf.json @@ -192,14 +192,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second oneOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both oneOf valid (complex)", @@ -277,11 +285,7 @@ "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "first valid - valid", @@ -289,7 +293,11 @@ "foo": 1, "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n", + "v3": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n" + } }, { "description": "second valid - valid", @@ -297,7 +305,11 @@ "foo": 1, "baz": 3 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n", + "v3": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n" + } }, { "description": "both valid - invalid", @@ -344,14 +356,22 @@ "data": { "bar": 8 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n", + "v3": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n" + } }, { "description": "second oneOf valid", "data": { "foo": "foo" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n", + "v3": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n" + } }, { "description": "both oneOf valid", @@ -359,22 +379,14 @@ "foo": "foo", "bar": 8 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "neither oneOf valid", "data": { "baz": "quux" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/required.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/required.json index 56cd0717c..5c941f89e 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/required.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/required.json @@ -24,11 +24,7 @@ "data": { "bar": 1 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "ignores arrays", @@ -112,11 +108,7 @@ "foo\nbar": "1", "foo\"bar": "1" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, @@ -145,22 +137,14 @@ { "description": "none of the properties mentioned", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "__proto__ present", "data": { "__proto__": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "toString present", @@ -169,11 +153,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "constructor present", @@ -182,11 +162,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "all present", diff --git a/encoding/jsonschema/testdata/external/tests/draft4/allOf.json b/encoding/jsonschema/testdata/external/tests/draft4/allOf.json index f82bbe413..3c65acb8f 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/allOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/allOf.json @@ -39,22 +39,14 @@ "data": { "foo": "baz" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "wrong type", @@ -116,11 +108,7 @@ "foo": "quux", "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first allOf", @@ -128,11 +116,7 @@ "bar": 2, "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch second allOf", @@ -140,22 +124,14 @@ "foo": "quux", "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch both", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft4/anyOf.json b/encoding/jsonschema/testdata/external/tests/draft4/anyOf.json index 7c157961c..39347b1f7 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/anyOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/anyOf.json @@ -97,14 +97,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second anyOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both anyOf valid (complex)", diff --git a/encoding/jsonschema/testdata/external/tests/draft4/enum.json b/encoding/jsonschema/testdata/external/tests/draft4/enum.json index ea737c332..b437e1709 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/enum.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/enum.json @@ -156,20 +156,12 @@ "data": { "foo": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "missing all properties is invalid", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft4/items.json b/encoding/jsonschema/testdata/external/tests/draft4/items.json index 840e4bf12..7ef0f067e 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/items.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/items.json @@ -304,11 +304,7 @@ } ] ], - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "fewer items is valid", @@ -326,7 +322,7 @@ ], "valid": true, "skip": { - "v2": "incompatible list lengths (2 and 3)\n", + "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n" } } diff --git a/encoding/jsonschema/testdata/external/tests/draft4/oneOf.json b/encoding/jsonschema/testdata/external/tests/draft4/oneOf.json index c126c70a0..a337e2aaf 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/oneOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/oneOf.json @@ -105,14 +105,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second oneOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both oneOf valid (complex)", @@ -188,11 +196,7 @@ "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "first valid - valid", @@ -200,7 +204,11 @@ "foo": 1, "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n", + "v3": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n" + } }, { "description": "second valid - valid", @@ -208,7 +216,11 @@ "foo": 1, "baz": 3 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n", + "v3": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n" + } }, { "description": "both valid - invalid", @@ -254,14 +266,22 @@ "data": { "bar": 8 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n", + "v3": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n" + } }, { "description": "second oneOf valid", "data": { "foo": "foo" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n", + "v3": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n" + } }, { "description": "both oneOf valid", @@ -269,22 +289,14 @@ "foo": "foo", "bar": 8 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "neither oneOf valid", "data": { "baz": "quux" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft4/required.json b/encoding/jsonschema/testdata/external/tests/draft4/required.json index 1cf726924..fe01ec11f 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/required.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/required.json @@ -23,11 +23,7 @@ "data": { "bar": 1 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "ignores arrays", @@ -92,11 +88,7 @@ "foo\nbar": "1", "foo\"bar": "1" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, @@ -124,22 +116,14 @@ { "description": "none of the properties mentioned", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "__proto__ present", "data": { "__proto__": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "toString present", @@ -148,11 +132,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "constructor present", @@ -161,11 +141,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "all present", diff --git a/encoding/jsonschema/testdata/external/tests/draft6/allOf.json b/encoding/jsonschema/testdata/external/tests/draft6/allOf.json index 2f756b0a3..16c231de0 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/allOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/allOf.json @@ -39,22 +39,14 @@ "data": { "foo": "baz" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "wrong type", @@ -116,11 +108,7 @@ "foo": "quux", "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first allOf", @@ -128,11 +116,7 @@ "bar": 2, "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch second allOf", @@ -140,22 +124,14 @@ "foo": "quux", "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch both", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft6/anyOf.json b/encoding/jsonschema/testdata/external/tests/draft6/anyOf.json index 30bef053b..e64af7e59 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/anyOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/anyOf.json @@ -153,14 +153,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second anyOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both anyOf valid (complex)", diff --git a/encoding/jsonschema/testdata/external/tests/draft6/enum.json b/encoding/jsonschema/testdata/external/tests/draft6/enum.json index ea737c332..b437e1709 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/enum.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/enum.json @@ -156,20 +156,12 @@ "data": { "foo": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "missing all properties is invalid", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft6/items.json b/encoding/jsonschema/testdata/external/tests/draft6/items.json index 7604aaa9b..9f05cfa57 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/items.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/items.json @@ -411,11 +411,7 @@ } ] ], - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "fewer items is valid", @@ -433,7 +429,7 @@ ], "valid": true, "skip": { - "v2": "incompatible list lengths (2 and 3)\n", + "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n" } } diff --git a/encoding/jsonschema/testdata/external/tests/draft6/oneOf.json b/encoding/jsonschema/testdata/external/tests/draft6/oneOf.json index cd5e22cf0..9a599a1de 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/oneOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/oneOf.json @@ -185,14 +185,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second oneOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both oneOf valid (complex)", @@ -268,11 +276,7 @@ "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "first valid - valid", @@ -280,7 +284,11 @@ "foo": 1, "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n", + "v3": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n" + } }, { "description": "second valid - valid", @@ -288,7 +296,11 @@ "foo": 1, "baz": 3 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n", + "v3": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n" + } }, { "description": "both valid - invalid", @@ -334,14 +346,22 @@ "data": { "bar": 8 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n", + "v3": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n" + } }, { "description": "second oneOf valid", "data": { "foo": "foo" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n", + "v3": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n" + } }, { "description": "both oneOf valid", @@ -349,22 +369,14 @@ "foo": "foo", "bar": 8 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "neither oneOf valid", "data": { "baz": "quux" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft6/required.json b/encoding/jsonschema/testdata/external/tests/draft6/required.json index b9311493c..d2bc7a365 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/required.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/required.json @@ -23,11 +23,7 @@ "data": { "bar": 1 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "ignores arrays", @@ -108,11 +104,7 @@ "foo\nbar": "1", "foo\"bar": "1" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, @@ -140,22 +132,14 @@ { "description": "none of the properties mentioned", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "__proto__ present", "data": { "__proto__": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "toString present", @@ -164,11 +148,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "constructor present", @@ -177,11 +157,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "all present", diff --git a/encoding/jsonschema/testdata/external/tests/draft7/allOf.json b/encoding/jsonschema/testdata/external/tests/draft7/allOf.json index 2f756b0a3..16c231de0 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/allOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/allOf.json @@ -39,22 +39,14 @@ "data": { "foo": "baz" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "wrong type", @@ -116,11 +108,7 @@ "foo": "quux", "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch first allOf", @@ -128,11 +116,7 @@ "bar": 2, "baz": null }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch second allOf", @@ -140,22 +124,14 @@ "foo": "quux", "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "mismatch both", "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft7/anyOf.json b/encoding/jsonschema/testdata/external/tests/draft7/anyOf.json index 30bef053b..e64af7e59 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/anyOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/anyOf.json @@ -153,14 +153,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second anyOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both anyOf valid (complex)", diff --git a/encoding/jsonschema/testdata/external/tests/draft7/enum.json b/encoding/jsonschema/testdata/external/tests/draft7/enum.json index ea737c332..b437e1709 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/enum.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/enum.json @@ -156,20 +156,12 @@ "data": { "foo": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "missing all properties is invalid", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft7/items.json b/encoding/jsonschema/testdata/external/tests/draft7/items.json index 7604aaa9b..9f05cfa57 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/items.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/items.json @@ -411,11 +411,7 @@ } ] ], - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "fewer items is valid", @@ -433,7 +429,7 @@ ], "valid": true, "skip": { - "v2": "incompatible list lengths (2 and 3)\n", + "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n" } } diff --git a/encoding/jsonschema/testdata/external/tests/draft7/oneOf.json b/encoding/jsonschema/testdata/external/tests/draft7/oneOf.json index cd5e22cf0..9a599a1de 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/oneOf.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/oneOf.json @@ -185,14 +185,22 @@ "data": { "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:2} | {bar:2,foo!:string}\n", + "v3": "incomplete value {bar:2} | {bar:2,foo!:string}\n" + } }, { "description": "second oneOf valid (complex)", "data": { "foo": "baz" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n", + "v3": "incomplete value {foo:\"baz\",bar!:int} | {foo:\"baz\"}\n" + } }, { "description": "both oneOf valid (complex)", @@ -268,11 +276,7 @@ "data": { "bar": 2 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "first valid - valid", @@ -280,7 +284,11 @@ "foo": 1, "bar": 2 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n", + "v3": "incomplete value {foo:1,bar:2} | {foo:1,bar:2,baz!:_}\n" + } }, { "description": "second valid - valid", @@ -288,7 +296,11 @@ "foo": 1, "baz": 3 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n", + "v3": "incomplete value {foo:1,baz:3,bar!:_} | {foo:1,baz:3}\n" + } }, { "description": "both valid - invalid", @@ -334,14 +346,22 @@ "data": { "bar": 8 }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n", + "v3": "incomplete value {bar:8,baz?:_} | {bar:8,foo!:_}\n" + } }, { "description": "second oneOf valid", "data": { "foo": "foo" }, - "valid": true + "valid": true, + "skip": { + "v2": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n", + "v3": "incomplete value {foo:\"foo\",bar!:_,baz?:_} | {foo:\"foo\"}\n" + } }, { "description": "both oneOf valid", @@ -349,22 +369,14 @@ "foo": "foo", "bar": 8 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "neither oneOf valid", "data": { "baz": "quux" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, diff --git a/encoding/jsonschema/testdata/external/tests/draft7/required.json b/encoding/jsonschema/testdata/external/tests/draft7/required.json index b9311493c..d2bc7a365 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/required.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/required.json @@ -23,11 +23,7 @@ "data": { "bar": 1 }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "ignores arrays", @@ -108,11 +104,7 @@ "foo\nbar": "1", "foo\"bar": "1" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false } ] }, @@ -140,22 +132,14 @@ { "description": "none of the properties mentioned", "data": {}, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "__proto__ present", "data": { "__proto__": "foo" }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "toString present", @@ -164,11 +148,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "constructor present", @@ -177,11 +157,7 @@ "length": 37 } }, - "valid": false, - "skip": { - "v2": "unexpected success", - "v3": "unexpected success" - } + "valid": false }, { "description": "all present",