this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

encoding/jsonschema: refactor reference handling

This refactors references to use a general system
that maps references through a new `MapRef` function
that supercedes the existing `MapURL` and `Map` functions.
To support this, we use the new `structBuilder` type
to build up the final syntax.

This fixes a bunch of existing reported and unreported issues, including:
- json pointer escaping: JSON pointers were not previously
escaped and unescaped correctly.
- references into internal structure: `$ref` references can now
reference arbitrary internal structure inside the schema
being extracted, including nodes that aren't actually schemas.
- better doc comments: the outer-level doc comment is
now correctly preserved in all circumstances

There are inevitably some changes in the form of the generated schemas:
- field ordering of definitions is now always lexical
- some comments move to new (better) locations
- attribute placement also moves to a (better) location
- by default, only top level `$defs` members are exported
as public definitions.

The last issue could be considered a backward incompatible
change, but in practice
- nested definitions are rare
- the nested definitions were not easily accessible anyway
in most cases (e.g. when inside a property or other expression)
- the new `MapRef` feature can be used to change the
location of any schema, including these.

As yet, the `MapRef` functionality as provided to the API
is not tested other than with `DefaultMapRef`, and the
`DefineSchemas` callback is not wired up. This will
land in a subsequent CL: in the meantime, what we've
got here seems sufficient as an intermediate step.

Fixes #3593
Fixes #3548
Updates #2699
Fixes #2287
Fixes #390

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Icfcff6e3d9f1d09f0418ddd493e01beb78045d59
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205706
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+1662 -1993
+11 -3
cmd/cue/cmd/testdata/script/def_comments.txtar
··· 85 85 } 86 86 } 87 87 -- stdout1 -- 88 + // This is a title 89 + // 90 + // top description 88 91 null | bool | number | string | [...] | { 89 92 // a description 90 93 a?: { ··· 95 98 ... 96 99 } 97 100 -- stdout1-def -- 101 + // This is a title 102 + // 103 + // top description 98 104 #top: null | bool | number | string | [...] | { 99 105 // a description 100 106 a?: { ··· 126 132 // This is a title 127 133 // 128 134 // top description 135 + // a description 129 136 a?: { 130 137 // b description 131 138 b?: number ··· 133 140 } 134 141 ... 135 142 -- stdout2-def -- 143 + // This is a title 144 + // 145 + // top description 136 146 #top: { 137 - // This is a title 138 - // 139 - // top description 147 + // a description 140 148 a?: { 141 149 // b description 142 150 b?: number
+2 -1
cmd/cue/cmd/testdata/script/def_jsonschema.txtar
··· 32 32 cmp stderr expect-stderr3 33 33 34 34 -- expect-stdout -- 35 + // Person 36 + 35 37 package schema 36 38 37 39 import "strings" 38 40 39 41 #Person: { 40 - // Person 41 42 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 42 43 @jsonschema(id="https://example.com/person.schema.json") 43 44
+5 -4
cmd/cue/cmd/testdata/script/import_auto.txtar
··· 21 21 version: *"v1beta1" | string 22 22 } 23 23 24 + #Bar: { 25 + foo!: #Foo 26 + ... 27 + } 28 + 24 29 #Foo: { 25 30 a!: int 26 31 b!: int & <10 & >=0 27 - ... 28 - } 29 - #Bar: { 30 - foo!: #Foo 31 32 ... 32 33 } 33 34 -- openapi.yaml --
+6 -6
encoding/jsonschema/constraints_combinator.go
··· 33 33 } 34 34 a := make([]ast.Expr, 0, len(items)) 35 35 for _, v := range items { 36 - x, sub := s.schemaState(v, s.allowedTypes, nil) 36 + x, sub := s.schemaState(v, s.allowedTypes) 37 37 s.allowedTypes &= sub.allowedTypes 38 38 if sub.hasConstraints { 39 39 // This might seem a little odd, since the actual ··· 79 79 } 80 80 a := make([]ast.Expr, 0, len(items)) 81 81 for _, v := range items { 82 - x, sub := s.schemaState(v, s.allowedTypes, nil) 82 + x, sub := s.schemaState(v, s.allowedTypes) 83 83 if sub.allowedTypes == 0 { 84 84 // Nothing is allowed; omit. 85 85 continue ··· 123 123 } 124 124 a := make([]ast.Expr, 0, len(items)) 125 125 for _, v := range items { 126 - x, sub := s.schemaState(v, s.allowedTypes, nil) 126 + x, sub := s.schemaState(v, s.allowedTypes) 127 127 if sub.allowedTypes == 0 { 128 128 // Nothing is allowed; omit 129 129 continue ··· 198 198 return 199 199 } 200 200 var ifExpr, thenExpr, elseExpr ast.Expr 201 - ifExpr, ifSub := s.schemaState(s.ifConstraint, s.allowedTypes, nil) 201 + ifExpr, ifSub := s.schemaState(s.ifConstraint, s.allowedTypes) 202 202 if hasThen { 203 203 // The allowed types of the "then" constraint are constrained both 204 204 // by the current constraints and the "if" constraint. 205 - thenExpr, _ = s.schemaState(s.thenConstraint, s.allowedTypes&ifSub.allowedTypes, nil) 205 + thenExpr, _ = s.schemaState(s.thenConstraint, s.allowedTypes&ifSub.allowedTypes) 206 206 } 207 207 if hasElse { 208 - elseExpr, _ = s.schemaState(s.elseConstraint, s.allowedTypes, nil) 208 + elseExpr, _ = s.schemaState(s.elseConstraint, s.allowedTypes) 209 209 } 210 210 if thenExpr == nil { 211 211 thenExpr = top()
+71 -41
encoding/jsonschema/constraints_generic.go
··· 15 15 package jsonschema 16 16 17 17 import ( 18 + "errors" 19 + "fmt" 20 + "net/url" 21 + "strings" 22 + 18 23 "cuelang.org/go/cue" 19 24 "cuelang.org/go/cue/ast" 20 - "cuelang.org/go/cue/errors" 21 25 "cuelang.org/go/cue/token" 22 26 ) 23 27 ··· 25 29 26 30 func constraintAddDefinitions(key string, n cue.Value, s *state) { 27 31 if n.Kind() != cue.StructKind { 28 - s.errf(n, `"definitions" expected an object, found %s`, n.Kind()) 32 + s.errf(n, `%q expected an object, found %s`, key, n.Kind()) 29 33 } 30 34 31 35 s.processMap(n, func(key string, n cue.Value) { 32 - name := key 33 - 34 - var f *ast.Field 35 - 36 - ident := "#" + name 37 - if ast.IsValidIdent(ident) { 38 - expr, sub := s.schemaState(n, allTypes, []label{{ident, true}}) 39 - f = &ast.Field{ 40 - Label: ast.NewIdent(ident), 41 - Value: expr, 42 - } 43 - sub.doc(f) 44 - } else { 45 - expr, sub := s.schemaState(n, allTypes, []label{{"#", true}, {name: name}}) 46 - inner := ast.NewStruct(&ast.Field{ 47 - Label: ast.NewString(name), 48 - Value: expr, 49 - }) 50 - // Ensure that we get `#: foo: ...` not `#: {foo: ...}` 51 - inner.Lbrace = token.NoPos 52 - ident = "#" 53 - f = &ast.Field{ 54 - Label: ast.NewIdent("#"), 55 - Value: inner, 56 - } 57 - sub.doc(f) 58 - } 59 - 60 - ast.SetRelPos(f, token.NewSection) 61 - s.definitions = append(s.definitions, f) 62 - s.setField(label{name: ident, isDef: true}, f) 36 + // Ensure that we are going to make a definition 37 + // for this node. 38 + s.ensureDefinition(n) 39 + s.schema(n) 63 40 }) 64 41 } 65 42 ··· 122 99 } 123 100 124 101 func constraintNullable(key string, n cue.Value, s *state) { 125 - // TODO: only allow for OpenAPI. 126 102 null := ast.NewNull() 127 103 setPos(null, n) 128 104 s.nullable = null ··· 130 106 131 107 func constraintRef(key string, n cue.Value, s *state) { 132 108 u := s.resolveURI(n) 133 - 134 - fragmentParts, err := splitFragment(u) 109 + if u == nil { 110 + return 111 + } 112 + schemaRoot := s.schemaRoot() 113 + if u.Fragment == "" && schemaRoot.isRoot && sameSchemaRoot(u, schemaRoot.id) { 114 + // It's a reference to the root of the schema being 115 + // generated. This never maps to something different. 116 + s.all.add(n, s.refExpr(n, "", cue.Path{})) 117 + return 118 + } 119 + importPath, path, err := cueLocationForRef(s, n, u, schemaRoot) 135 120 if err != nil { 136 - s.addErr(errors.Newf(n.Pos(), "%v", err)) 121 + s.errf(n, "%v", err) 137 122 return 138 123 } 139 - expr := s.makeCUERef(n, u, fragmentParts) 140 - if expr == nil { 141 - expr = &ast.BadExpr{From: n.Pos()} 124 + if e := s.refExpr(n, importPath, path); e != nil { 125 + s.all.add(n, e) 142 126 } 127 + } 143 128 144 - s.all.add(n, expr) 129 + func cueLocationForRef(s *state, n cue.Value, u *url.URL, schemaRoot *state) (importPath string, path cue.Path, err error) { 130 + if ds, ok := s.defs[u.String()]; ok { 131 + // We already know about the schema, so use the information that's stored for it. 132 + return ds.importPath, ds.path, nil 133 + } 134 + loc := SchemaLoc{ 135 + ID: u, 136 + } 137 + var base cue.Value 138 + isAnchor := u.Fragment != "" && !strings.HasPrefix(u.Fragment, "/") 139 + if !isAnchor { 140 + // It's a JSON pointer reference. 141 + if sameSchemaRoot(u, s.rootID) { 142 + base = s.root 143 + } else if sameSchemaRoot(u, schemaRoot.id) { 144 + // it's within the current schema. 145 + base = schemaRoot.pos 146 + } 147 + if base.Exists() { 148 + target, err := lookupJSONPointer(schemaRoot.pos, u.Fragment) 149 + if err != nil { 150 + if errors.Is(err, errRefNotFound) { 151 + return "", cue.Path{}, fmt.Errorf("reference to non-existent schema") 152 + } 153 + return "", cue.Path{}, fmt.Errorf("invalid JSON Pointer: %v", err) 154 + } 155 + if ds := s.defForValue.get(target); ds != nil { 156 + // There's a definition in place for the value, which gives 157 + // us our answer. 158 + return ds.importPath, ds.path, nil 159 + } 160 + s.ensureDefinition(target) 161 + loc.IsLocal = true 162 + loc.Path = relPath(target, s.root) 163 + } 164 + } 165 + importPath, path, err = s.cfg.MapRef(loc) 166 + if err != nil { 167 + return "", cue.Path{}, fmt.Errorf("cannot determine CUE location for JSON Schema location %v: %v", loc, err) 168 + } 169 + // TODO we'd quite like to avoid invoking MapRef many times 170 + // for the same reference, but in general we don't necessily know 171 + // the canonical URI of the schema until we've done at least one pass. 172 + // There are potentially ways to do it, but leave it for now in favor 173 + // of simplicity. 174 + return importPath, path, nil 145 175 } 146 176 147 177 func constraintTitle(key string, n cue.Value, s *state) {
+2 -2
encoding/jsonschema/constraints_meta.go
··· 24 24 // URL: https://domain.com/schemas/foo.json 25 25 // anchors: #identifier 26 26 // 27 - // TODO: mark identifiers. 27 + // TODO: mark anchors 28 28 29 - // Resolution must be relative to parent $id 29 + // Resolution is relative to parent $id 30 30 // https://tools.ietf.org/html/draft-handrews-json-schema-02#section-8.2.2 31 31 u := s.resolveURI(n) 32 32 if u == nil {
+5 -6
encoding/jsonschema/constraints_object.go
··· 118 118 s.processMap(n, func(key string, n cue.Value) { 119 119 // property?: value 120 120 name := ast.NewString(key) 121 - expr, state := s.schemaState(n, allTypes, []label{{name: key}}) 121 + expr, state := s.schemaState(n, allTypes) 122 122 f := &ast.Field{Label: name, Value: expr} 123 - state.doc(f) 123 + if doc := state.comment(); doc != nil { 124 + ast.SetComments(f, []*ast.CommentGroup{doc}) 125 + } 124 126 f.Optional = token.Blank.Pos() 125 127 if len(obj.Elts) > 0 && len(f.Comments()) > 0 { 126 128 // TODO: change formatter such that either a NewSection on the ··· 136 138 } 137 139 } 138 140 obj.Elts = append(obj.Elts, f) 139 - s.setField(label{name: key}, f) 140 141 }) 141 142 } 142 143 143 144 func constraintPropertyNames(key string, n cue.Value, s *state) { 144 145 // [=~pattern]: _ 145 - if names, _ := s.schemaState(n, cue.StringKind, nil); !isTop(names) { 146 + if names, _ := s.schemaState(n, cue.StringKind); !isTop(names) { 146 147 x := ast.NewStruct(ast.NewList(names), top()) 147 148 s.add(n, objectType, x) 148 149 } ··· 154 155 return 155 156 } 156 157 157 - // TODO: detect that properties is defined somewhere. 158 - // s.errf(n, `"required" without a "properties" field`) 159 158 obj := s.object(n) 160 159 161 160 // Create field map
+291 -165
encoding/jsonschema/decode.go
··· 34 34 "cuelang.org/go/cue/errors" 35 35 "cuelang.org/go/cue/token" 36 36 "cuelang.org/go/internal" 37 + "cuelang.org/go/mod/module" 38 + ) 39 + 40 + const ( 41 + // DefaultRootID is used as the absolute base URI for a schema 42 + // when no value is provided in [Config.ID]. 43 + DefaultRootID = "https://" + DefaultRootIDHost 44 + DefaultRootIDHost = "cue.jsonschema.invalid" 37 45 ) 38 46 39 47 // rootDefs defines the top-level name of the map of definitions that do not 40 48 // have a valid identifier name. 41 49 // 42 - // TODO: find something more principled, like allowing #."a-b" or `#a-b`. 50 + // TODO: find something more principled, like allowing #("a-b"). 43 51 const rootDefs = "#" 44 52 45 53 // A decoder converts JSON schema to CUE. 46 54 type decoder struct { 47 55 cfg *Config 48 56 errs errors.Error 49 - numID int // for creating unique numbers: increment on each use 50 57 mapURLErrors map[string]bool 51 - // self holds the struct literal that will eventually be embedded 52 - // in the top level file. It is only set when decoder.rootRef is 53 - // called. 54 - self *ast.StructLit 58 + 59 + root cue.Value 60 + rootID *url.URL 61 + 62 + // defForValue holds an entry for internal values 63 + // that are known to map to a defined schema. 64 + // A nil entry is stored for nodes that have been 65 + // referred to but we haven't yet seen when walking 66 + // the schemas. 67 + defForValue *valueMap[*definedSchema] 68 + 69 + // danglingRefs records the number of nil entries in defForValue, 70 + // representing the number of references into the internal 71 + // structure that have not yet been resolved. 72 + danglingRefs int 73 + 74 + // defs holds the set of named schemas, indexed by URI (both 75 + // canonical, and root-relative if known), including external 76 + // schemas that aren't known. 77 + defs map[string]*definedSchema 78 + 79 + // builder is used to build the final syntax tree as it becomes known. 80 + builder structBuilder 81 + 82 + // needAnotherPass is set to true when we know that 83 + // we need another pass through the schema extraction 84 + // process. This can happen because `MapRef` might choose 85 + // a different location depending on whether a reference is local 86 + // or external. We don't know that until we've traversed the 87 + // entire schema and the `$ref` might be seen before the 88 + // schema it's referring to. Still more passes might be required 89 + // if a $ref is found to be referring to a node that would not normally 90 + // be considered part of the schema data. 91 + needAnotherPass bool 92 + } 93 + 94 + // definedSchema records information for a schema or subschema. 95 + type definedSchema struct { 96 + // importPath is empty for internal schemas. 97 + importPath string 98 + 99 + // path holds the location of the schema relative to importPath. 100 + path cue.Path 101 + 102 + // schema holds the actual syntax for the schema. This 103 + // is nil if the entry was created by a reference only. 104 + schema ast.Expr 55 105 } 56 106 57 107 // addImport registers ··· 76 126 f.Decls = append(f.Decls, pkg) 77 127 } 78 128 79 - var a []ast.Decl 80 - 81 - if d.cfg.Root == "" { 82 - a = append(a, d.schema(nil, v)...) 83 - } else { 84 - ref := d.parseRef(token.NoPos, d.cfg.Root) 85 - if ref == nil { 86 - return f 87 - } 88 - var selectors []cue.Selector 89 - for _, r := range ref { 90 - selectors = append(selectors, cue.Str(r)) 91 - } 92 - i, err := v.LookupPath(cue.MakePath(selectors...)).Fields() 129 + var defsRoot cue.Value 130 + if d.cfg.Root != "" { 131 + defsPath, err := parseRootRef(d.cfg.Root) 93 132 if err != nil { 94 - d.errs = errors.Append(d.errs, errors.Promote(err, "")) 133 + d.errf(cue.Value{}, "invalid Config.Root value %q: %v", d.cfg.Root, err) 95 134 return nil 96 135 } 97 - for i.Next() { 98 - ref := append(ref, i.Selector().Unquoted()) 99 - lab := d.mapRef(i.Value().Pos(), "", ref) 100 - if len(lab) == 0 { 101 - return nil 102 - } 103 - decls := d.schema(lab, i.Value()) 104 - a = append(a, decls...) 136 + defsRoot = v.LookupPath(defsPath) 137 + if kind := defsRoot.Kind(); kind != cue.StructKind { 138 + d.errf(defsRoot, "value at path %v must be struct containing definitions but is actually %v", d.cfg.Root, defsRoot) 139 + return nil 105 140 } 106 141 } 107 142 108 - f.Decls = append(f.Decls, a...) 109 - 110 - _ = astutil.Sanitize(f) 111 - 112 - return f 113 - } 114 - 115 - func (d *decoder) schema(ref []ast.Label, v cue.Value) (a []ast.Decl) { 116 - root := state{ 117 - decoder: d, 118 - schemaInfo: schemaInfo{ 119 - schemaVersion: d.cfg.DefaultVersion, 120 - }, 121 - isRoot: true, 122 - } 123 - 124 - var name ast.Label 125 - inner := len(ref) - 1 126 - 127 - if inner >= 0 { 128 - name = ref[inner] 129 - } 143 + var rootInfo schemaInfo 144 + // extraSchemas records any nodes that are referred to 145 + // but not part of the regular schema traversal. 146 + var extraSchemas []cue.Value 147 + // basePass records the last time that any new schemas were 148 + // added for inspection. This can be set whenever new schemas 149 + // not part of the regular traversal are found. 150 + basePass := 0 130 151 131 - expr, state := root.schemaState(v, allTypes, nil) 132 - if state.allowedTypes == 0 { 133 - d.addErr(errors.Newf(v.Pos(), "constraints are not possible to satisfy")) 134 - } 135 - 136 - tags := []string{} 137 - if state.schemaVersionPresent { 138 - // TODO use cue/literal.String 139 - tags = append(tags, fmt.Sprintf("schema=%q", state.schemaVersion)) 140 - } 141 - 142 - if name == nil { 143 - if len(tags) > 0 { 144 - body := strings.Join(tags, ",") 145 - a = append(a, &ast.Attribute{ 146 - Text: fmt.Sprintf("@jsonschema(%s)", body)}) 152 + for pass := 0; ; pass++ { 153 + if pass > 10 { 154 + // Should never happen: the most we should ever see in practice 155 + // should be 2, but some pathological cases could end up with more. 156 + d.errf(v, "internal error: too many passes without resolution") 157 + return nil 158 + } 159 + root := &state{ 160 + decoder: d, 161 + schemaInfo: schemaInfo{ 162 + schemaVersion: d.cfg.DefaultVersion, 163 + id: d.rootID, 164 + }, 165 + isRoot: true, 166 + pos: v, 147 167 } 148 168 149 - if state.deprecated { 150 - a = append(a, &ast.Attribute{Text: "@deprecated()"}) 169 + if defsRoot.Exists() { 170 + // When d.cfg.Root is non-empty, it points to a struct 171 + // containing a field for each definition. 172 + constraintAddDefinitions("schemas", defsRoot, root) 173 + } else { 174 + expr, state := root.schemaState(v, allTypes) 175 + if state.allowedTypes == 0 { 176 + root.errf(v, "constraints are not possible to satisfy") 177 + return nil 178 + } 179 + if !d.builder.put(cue.Path{}, expr, state.comment()) { 180 + root.errf(v, "duplicate definition at root") // TODO better error message 181 + return nil 182 + } 183 + rootInfo = state 151 184 } 152 - } else { 153 - if len(tags) > 0 { 154 - a = append(a, addTag(name, "jsonschema", strings.Join(tags, ","))) 185 + if d.danglingRefs > 0 && pass == basePass+1 { 186 + // There are still dangling references but we've been through the 187 + // schema twice, so we know that there's a reference 188 + // to a non-schema node. Technically this is not necessarily valid, 189 + // but we do see this in the wild. This should be rare, 190 + // so efficiency (re-parsing paths) shouldn't be a great issue. 191 + for path, def := range d.defForValue.byPath { 192 + if def != nil { 193 + continue 194 + } 195 + n := d.root.LookupPath(cue.ParsePath(path)) 196 + if !n.Exists() { 197 + panic("failed to find entry for dangling reference") 198 + } 199 + extraSchemas = append(extraSchemas, n) 200 + basePass = pass 201 + } 155 202 } 156 - 157 - if state.deprecated { 158 - a = append(a, addTag(name, "deprecated", "")) 203 + for _, n := range extraSchemas { 204 + // As the ID namespace isn't well-defined we treat all such 205 + // schemas as if they were directly under the root. 206 + // See https://json-schema.org/draft/2020-12/json-schema-core#section-9.4.2 207 + root.schema(n) 159 208 } 160 - } 161 - 162 - if name != nil { 163 - f := &ast.Field{ 164 - Label: name, 165 - Value: expr, 209 + if !d.needAnotherPass && d.danglingRefs == 0 { 210 + break 166 211 } 167 212 168 - a = append(a, f) 169 - } else if st, ok := expr.(*ast.StructLit); ok && len(st.Elts) > 0 { 170 - a = append(a, st.Elts...) 171 - } else { 172 - a = append(a, &ast.EmbedDecl{Expr: expr}) 173 - } 174 - 175 - if len(a) > 0 { 176 - state.doc(a[0]) 213 + d.builder = structBuilder{} 214 + d.needAnotherPass = false 177 215 } 178 - for i := inner - 1; i >= 0; i-- { 179 - a = []ast.Decl{&ast.Field{ 180 - Label: ref[i], 181 - Value: &ast.StructLit{Elts: a}, 182 - }} 183 - expr = ast.NewStruct(ref[i], expr) 216 + f, err := d.builder.syntax() 217 + if err != nil { 218 + d.errf(v, "cannot build final syntax: %v", err) 219 + return nil 184 220 } 185 - 186 - if root.self == nil { 187 - return a 221 + var attrs []ast.Decl 222 + if rootInfo.schemaVersionPresent { 223 + // TODO use cue/literal.String 224 + // TODO is this actually useful information: why is knowing the schema 225 + // version of the input useful? 226 + attrs = append(attrs, &ast.Attribute{ 227 + Text: fmt.Sprintf("@jsonschema(schema=%q)", rootInfo.schemaVersion), 228 + }) 188 229 } 189 - root.self.Elts = a 190 - return []ast.Decl{ 191 - &ast.EmbedDecl{Expr: d.rootRef()}, 192 - &ast.Field{ 193 - Label: d.rootRef(), 194 - Value: root.self, 195 - }, 230 + if rootInfo.deprecated { 231 + attrs = append(attrs, &ast.Attribute{Text: "@deprecated()"}) 196 232 } 197 - } 198 - 199 - // rootRef returns a reference to the top of the file. We do this by 200 - // creating a helper schema: 201 - // 202 - // _schema: {...} 203 - // _schema 204 - // 205 - // This is created at the finalization stage, signaled by d.self being 206 - // set, which rootRef does as a side-effect. 207 - func (d *decoder) rootRef() *ast.Ident { 208 - ident := ast.NewIdent("_schema") 209 - if d.self == nil { 210 - d.self = &ast.StructLit{} 233 + if len(attrs) > 0 { 234 + f.Decls = append(attrs, f.Decls...) 211 235 } 212 - // Ensure that all self-references refer to the same node. 213 - ident.Node = d.self 214 - return ident 236 + return f 215 237 } 216 238 217 239 func (d *decoder) errf(n cue.Value, format string, args ...interface{}) ast.Expr { ··· 290 312 // runtime). In other words, this is a missing feature but not an invalid 291 313 // regular expression as such. 292 314 if d.cfg.StrictFeatures { 315 + // TODO: could fall back to https://github.com/dlclark/regexp2 instead 293 316 d.errf(n, "unsupported Perl regexp syntax in %q: %v", s, err) 294 317 } 295 318 return false ··· 308 331 return false 309 332 } 310 333 334 + // ensureDefinition ensures that node n will 335 + // be a defined schema. 336 + func (d *decoder) ensureDefinition(n cue.Value) { 337 + if _, ok := d.defForValue.lookup(n); !ok { 338 + d.defForValue.set(n, nil) 339 + d.danglingRefs++ 340 + } 341 + } 342 + 311 343 // const draftCutoff = 5 312 344 313 345 type coreType int ··· 402 434 403 435 up *state 404 436 405 - path []string 406 - 407 - // idRef is used to refer to this schema in case it defines an $id. 408 - idRef []label 409 - 410 437 pos cue.Value 411 438 412 439 // The constraints in types represent disjunctions per type. ··· 434 461 ifConstraint cue.Value 435 462 thenConstraint cue.Value 436 463 elseConstraint cue.Value 437 - 438 - id *url.URL // base URI for $ref 439 464 440 465 definitions []ast.Decl 441 466 442 467 // Used for inserting definitions, properties, etc. 443 468 obj *ast.StructLit 444 469 objN cue.Value // used for adding obj to constraints 445 - // Complete at finalize. 446 - fieldRefs map[label]refs 447 470 448 471 closeStruct bool 449 472 patterns []ast.Expr ··· 477 500 478 501 title string 479 502 description string 480 - deprecated bool 503 + 504 + // id holds the absolute URI of the schema if has a $id field . 505 + // It's the base URI for $ref or nested $id fields. 506 + id *url.URL 507 + deprecated bool 481 508 482 509 schemaVersion Version 483 510 schemaVersionPresent bool ··· 485 512 hasConstraints bool 486 513 } 487 514 488 - type label struct { 489 - name string 490 - isDef bool 491 - } 492 - 493 - type refs struct { 494 - field *ast.Field 495 - ident string 496 - refs []*ast.Ident 497 - } 498 - 499 515 func (s *state) idTag() *ast.Attribute { 500 516 return &ast.Attribute{Text: fmt.Sprintf("@jsonschema(id=%q)", s.id)} 501 517 } ··· 544 560 s.id != nil 545 561 } 546 562 547 - const allTypes = cue.NullKind | cue.BoolKind | cue.NumberKind | cue.IntKind | 548 - cue.StringKind | cue.ListKind | cue.StructKind 563 + const allTypes = cue.BoolKind | 564 + cue.ListKind | 565 + cue.NullKind | 566 + cue.NumberKind | 567 + cue.IntKind | 568 + cue.StringKind | 569 + cue.StructKind 549 570 550 - // finalize constructs a CUE type from the collected constraints. 571 + // finalize constructs CUE syntax from the collected constraints. 551 572 func (s *state) finalize() (e ast.Expr) { 552 573 if s.allowedTypes == 0 { 553 574 // Nothing is possible. This isn't a necessarily a problem, as ··· 675 696 } 676 697 } 677 698 678 - s.linkReferences() 679 - 680 699 // If an "$id" exists and has not been included in any object constraints 681 700 if s.id != nil && s.obj == nil { 682 701 if st, ok := e.(*ast.StructLit); ok { ··· 710 729 return internal.NewComment(true, doc) 711 730 } 712 731 713 - func (s schemaInfo) doc(n ast.Node) { 714 - doc := s.comment() 715 - if doc != nil { 716 - ast.SetComments(n, []*ast.CommentGroup{doc}) 717 - } 718 - } 719 - 720 - func (s *state) schema(n cue.Value, idRef ...label) ast.Expr { 721 - expr, _ := s.schemaState(n, allTypes, idRef) 722 - // TODO: report unused doc. 732 + func (s *state) schema(n cue.Value) ast.Expr { 733 + expr, _ := s.schemaState(n, allTypes) 723 734 return expr 724 735 } 725 736 726 737 // schemaState returns a new state value derived from s. 727 738 // n holds the JSONSchema node to translate to a schema. 728 739 // types holds the set of possible types that the value can hold. 729 - // idRef holds the path to the value. 730 - // isLogical specifies whether the caller is a logical operator like anyOf, allOf, oneOf, or not. 731 - func (s0 *state) schemaState(n cue.Value, types cue.Kind, idRef []label) (ast.Expr, schemaInfo) { 740 + func (s0 *state) schemaState(n cue.Value, types cue.Kind) (expr ast.Expr, ingo schemaInfo) { 732 741 s := &state{ 733 742 up: s0, 734 743 schemaInfo: schemaInfo{ ··· 737 746 knownTypes: allTypes, 738 747 }, 739 748 decoder: s0.decoder, 740 - idRef: idRef, 741 749 pos: n, 742 750 isRoot: s0.isRoot && n == s0.pos, 743 751 } 752 + defer func() { 753 + // Perhaps replace the schema expression with a reference. 754 + expr = s.maybeDefine(expr) 755 + }() 744 756 if n.Kind() == cue.BoolKind { 745 757 if vfrom(VersionDraft6).contains(s.schemaVersion) { 746 758 // From draft6 onwards, boolean values signify a schema that always passes or fails. 759 + // TODO if false, set s.allowedTypes and s.knownTypes to zero? 747 760 return boolSchema(s.boolValue(n)), s.schemaInfo 748 761 } 749 762 return s.errf(n, "boolean schemas not supported in %v", s.schemaVersion), s.schemaInfo ··· 804 817 c.fn(key, value, s) 805 818 }) 806 819 } 820 + if s.id != nil { 821 + // If there's an ID, it can be referred to. 822 + s.ensureDefinition(s.pos) 823 + } 807 824 constraintIfThenElse(s) 808 825 809 - expr := s.finalize() 826 + schemaExpr := s.finalize() 810 827 s.schemaInfo.hasConstraints = s.hasConstraints() 811 - return expr, s.schemaInfo 828 + return schemaExpr, s.schemaInfo 829 + } 830 + 831 + // maybeDefine checks whether we might need a definition 832 + // for n given its actual schema syntax expression. If 833 + // it does, it creates the definition as appropriate and returns 834 + // an expression that refers to that definition; if not, 835 + // it just returns expr itself. 836 + // TODO also report whether the schema has been defined at a place 837 + // where it can be unified with something else? 838 + func (s *state) maybeDefine(expr ast.Expr) ast.Expr { 839 + def := s.definedSchemaForNode(s.pos) 840 + if def == nil || len(def.path.Selectors()) == 0 { 841 + return expr 842 + } 843 + def.schema = expr 844 + if def.importPath == "" { 845 + // It's a local definition that's not at the root. 846 + if !s.builder.put(def.path, expr, s.comment()) { 847 + s.errf(s.pos, "redefinition of schema CUE path %v", def.path) 848 + return expr 849 + } 850 + } 851 + return s.refExpr(s.pos, def.importPath, def.path) 852 + } 853 + 854 + // definedSchemaForNode returns the definedSchema value 855 + // for the given node in the JSON schema, or nil 856 + // if the node does not need a definition. 857 + func (s *state) definedSchemaForNode(n cue.Value) *definedSchema { 858 + def, ok := s.defForValue.lookup(n) 859 + if !ok { 860 + return nil 861 + } 862 + if def != nil { 863 + // We've either made a definition in a previous pass 864 + // or it's a redefinition. 865 + // TODO if it's a redefinition, error. 866 + return def 867 + } 868 + // This node has been referred to but not actually defined. We'll 869 + // need another pass to sort out the reference even though the 870 + // reference is no longer dangling. 871 + s.needAnotherPass = true 872 + 873 + def = s.addDefinition(n) 874 + if def == nil { 875 + return nil 876 + } 877 + s.defForValue.set(n, def) 878 + s.danglingRefs-- 879 + return def 880 + } 881 + 882 + func (s *state) addDefinition(n cue.Value) *definedSchema { 883 + var loc SchemaLoc 884 + schemaRoot := s.schemaRoot() 885 + loc.ID = ref(*schemaRoot.id) 886 + loc.ID.Fragment = cuePathToJSONPointer(relPath(n, schemaRoot.pos)) 887 + idStr := loc.ID.String() 888 + def, ok := s.defs[idStr] 889 + if ok { 890 + // We've already got a definition for this ID. 891 + // TODO if it's been defined in the same pass, then it's a redefinition 892 + // s.errf(n, "redefinition of schema %s at %v", idStr, n.Path()) 893 + return def 894 + } 895 + loc.IsLocal = true 896 + loc.Path = relPath(n, s.root) 897 + importPath, path, err := s.cfg.MapRef(loc) 898 + if err != nil { 899 + s.errf(n, "cannot get reference for %v", loc) 900 + return nil 901 + } 902 + def = &definedSchema{ 903 + importPath: importPath, 904 + path: path, 905 + } 906 + s.defs[idStr] = def 907 + return def 908 + } 909 + 910 + // refExpr returns a CUE expression to refer to the given path within the given 911 + // imported CUE package. If importPath is empty, it returns a reference 912 + // relative to the root of the schema being generated. 913 + func (s *state) refExpr(n cue.Value, importPath string, path cue.Path) ast.Expr { 914 + if importPath == "" { 915 + // Internal reference 916 + expr, err := s.builder.getRef(path) 917 + if err != nil { 918 + s.errf(n, "cannot generate reference: %v", err) 919 + return nil 920 + } 921 + return expr 922 + } 923 + // External reference 924 + ip := module.ParseImportPath(importPath) 925 + if ip.Qualifier == "" { 926 + // TODO choose an arbitrary name here. 927 + s.errf(n, "cannot determine package name from import path %q", importPath) 928 + return nil 929 + } 930 + ident := ast.NewIdent(ip.Qualifier) 931 + ident.Node = &ast.ImportSpec{Path: ast.NewString(importPath)} 932 + expr, err := pathRefSyntax(path, ident) 933 + if err != nil { 934 + s.errf(n, "cannot determine CUE path: %v", err) 935 + return nil 936 + } 937 + return expr 812 938 } 813 939 814 940 func (s *state) constValue(n cue.Value) ast.Expr {
+3 -1
encoding/jsonschema/decode_test.go
··· 279 279 }, 280 280 }) 281 281 qt.Assert(t, qt.Equals(errors.Details(err, nil), ` 282 - cannot determine import path from URL "https://something.test/foo": some error: 282 + cannot determine CUE location for JSON Schema location id=https://something.test/foo#/definitions/x: some error: 283 283 foo.cue:4:5 284 + cannot determine CUE location for JSON Schema location id=https://something.test/foo#/definitions/y: some error: 285 + foo.cue:5:5 284 286 `[1:])) 285 287 } 286 288
+12 -12
encoding/jsonschema/external_teststats.txt
··· 1 1 # Generated by CUE_UPDATE=1 go test. DO NOT EDIT 2 2 v2: 3 - schema extract (pass / total): 1013 / 1363 = 74.3% 4 - tests (pass / total): 3676 / 4803 = 76.5% 5 - tests on extracted schemas (pass / total): 3676 / 3865 = 95.1% 3 + schema extract (pass / total): 1054 / 1363 = 77.3% 4 + tests (pass / total): 3788 / 4803 = 78.9% 5 + tests on extracted schemas (pass / total): 3788 / 3955 = 95.8% 6 6 7 7 v3: 8 - schema extract (pass / total): 1013 / 1363 = 74.3% 9 - tests (pass / total): 3666 / 4803 = 76.3% 10 - tests on extracted schemas (pass / total): 3666 / 3865 = 94.9% 8 + schema extract (pass / total): 1054 / 1363 = 77.3% 9 + tests (pass / total): 3778 / 4803 = 78.7% 10 + tests on extracted schemas (pass / total): 3778 / 3955 = 95.5% 11 11 12 12 Optional tests 13 13 14 14 v2: 15 - schema extract (pass / total): 220 / 274 = 80.3% 16 - tests (pass / total): 1596 / 2372 = 67.3% 17 - tests on extracted schemas (pass / total): 1596 / 2223 = 71.8% 15 + schema extract (pass / total): 235 / 274 = 85.8% 16 + tests (pass / total): 1635 / 2372 = 68.9% 17 + tests on extracted schemas (pass / total): 1635 / 2262 = 72.3% 18 18 19 19 v3: 20 - schema extract (pass / total): 220 / 274 = 80.3% 21 - tests (pass / total): 1596 / 2372 = 67.3% 22 - tests on extracted schemas (pass / total): 1596 / 2223 = 71.8% 20 + schema extract (pass / total): 235 / 274 = 85.8% 21 + tests (pass / total): 1635 / 2372 = 68.9% 22 + tests on extracted schemas (pass / total): 1635 / 2262 = 72.3%
+132 -7
encoding/jsonschema/jsonschema.go
··· 32 32 package jsonschema 33 33 34 34 import ( 35 + "fmt" 35 36 "net/url" 36 37 37 38 "cuelang.org/go/cue" 38 39 "cuelang.org/go/cue/ast" 40 + "cuelang.org/go/cue/ast/astutil" 39 41 "cuelang.org/go/cue/token" 40 42 ) 41 43 ··· 43 45 // 44 46 // The generated CUE schema is guaranteed to deem valid any value that is 45 47 // a valid instance of the source JSON schema. 46 - func Extract(data cue.InstanceOrValue, cfg *Config) (f *ast.File, err error) { 48 + func Extract(data cue.InstanceOrValue, cfg *Config) (*ast.File, error) { 47 49 cfg = ref(*cfg) 48 50 if cfg.MapURL == nil { 49 51 cfg.MapURL = DefaultMapURL 50 52 } 53 + if cfg.Map == nil { 54 + cfg.Map = defaultMap 55 + } 56 + if cfg.MapRef == nil { 57 + cfg.MapRef = func(loc SchemaLoc) (string, cue.Path, error) { 58 + return defaultMapRef(loc, cfg.Map, cfg.MapURL) 59 + } 60 + } 51 61 if cfg.DefaultVersion == VersionUnknown { 52 62 cfg.DefaultVersion = DefaultVersion 53 63 } ··· 55 65 cfg.StrictKeywords = true 56 66 cfg.StrictFeatures = true 57 67 } 68 + if cfg.ID == "" { 69 + // Always choose a fully-qualified ID for the schema, even 70 + // if it doesn't declare one. 71 + // 72 + // From https://json-schema.org/draft-07/draft-handrews-json-schema-01#rfc.section.8.1 73 + // > Informatively, the initial base URI of a schema is the URI at which it was found, or a suitable substitute URI if none is known. 74 + cfg.ID = DefaultRootID 75 + } 76 + rootIDURI, err := url.Parse(cfg.ID) 77 + if err != nil { 78 + return nil, fmt.Errorf("invalid Config.ID value %q: %v", cfg.ID, err) 79 + } 80 + if !rootIDURI.IsAbs() { 81 + return nil, fmt.Errorf("Config.ID %q is not absolute URI", cfg.ID) 82 + } 58 83 d := &decoder{ 59 84 cfg: cfg, 60 85 mapURLErrors: make(map[string]bool), 86 + root: data.Value(), 87 + rootID: rootIDURI, 88 + defs: make(map[string]*definedSchema), 89 + defForValue: newValueMap[*definedSchema](), 61 90 } 62 91 63 - f = d.decode(data.Value()) 92 + f := d.decode(d.root) 64 93 if d.errs != nil { 65 94 return nil, d.errs 66 95 } 67 - 96 + if err := astutil.Sanitize(f); err != nil { 97 + return nil, fmt.Errorf("cannot sanitize jsonschema resulting syntax: %v", err) 98 + } 68 99 return f, nil 69 100 } 70 101 ··· 79 110 // ID sets the URL of the original source, corresponding to the $id field. 80 111 ID string 81 112 82 - // JSON reference of location containing schema. The empty string indicates 83 - // that there is a single schema at the root. 113 + // JSON reference of location containing schemas. The empty string indicates 114 + // that there is a single schema at the root. If this is non-empty, 115 + // the referred-to location should be an object, and each member 116 + // is taken to be a schema. 84 117 // 85 118 // Examples: 86 - // "#/" top-level fields are schemas. 119 + // "#/" or "#" top-level fields are schemas. 87 120 // "#/components/schemas" the canonical OpenAPI location. 121 + // 122 + // Note: #/ should technically _not_ refer to the root of the 123 + // schema: this behavior is preserved for backwards compatibility 124 + // only. Just `#` is preferred. 88 125 Root string 89 126 90 127 // Map maps the locations of schemas and definitions to a new location. ··· 95 132 // {} {} 96 133 // {"definitions", foo} {#foo} or {#, foo} 97 134 // {"$defs", foo} {#foo} or {#, foo} 135 + // 136 + // Deprecated: use [Config.MapRef]. 98 137 Map func(pos token.Pos, path []string) ([]ast.Label, error) 99 138 100 139 // MapURL maps a URL reference as found in $ref to 101 - // an import path for a package and a path within that package. 140 + // an import path for a CUE package and a path within that package. 102 141 // If this is nil, [DefaultMapURL] will be used. 142 + // 143 + // Deprecated: use [Config.MapRef]. 103 144 MapURL func(u *url.URL) (importPath string, path cue.Path, err error) 104 145 146 + // NOTE: this method is currently experimental. Its usage and type 147 + // signature may change. 148 + // 149 + // MapRef is used to determine how a JSON schema location maps to 150 + // CUE. It is used for both explicit references and for named 151 + // schemas inside $defs and definitions. 152 + // 153 + // For example, given this schema: 154 + // 155 + // { 156 + // "$schema": "https://json-schema.org/draft/2020-12/schema", 157 + // "$id": "https://my.schema.org/hello", 158 + // "$defs": { 159 + // "foo": { 160 + // "$id": "https://other.org", 161 + // "type": "object", 162 + // "properties": { 163 + // "a": { 164 + // "type": "string" 165 + // }, 166 + // "b": { 167 + // "$ref": "#/properties/a" 168 + // } 169 + // } 170 + // } 171 + // }, 172 + // "allOf": [{ 173 + // "$ref": "#/$defs/foo" 174 + // }, { 175 + // "$ref": "https://my.schema.org/hello#/$defs/foo" 176 + // }, { 177 + // "$ref": "https://other.org" 178 + // }, { 179 + // "$ref": "https://external.ref" 180 + // }] 181 + // } 182 + // 183 + // ... MapRef will be called with the following locations for the 184 + // $ref keywords in order of appearance (no guarantees are made 185 + // about the actual order or number of calls to MapRef): 186 + // 187 + // ID RootRel 188 + // https://other.org/properties/a https://my.schema.org/hello#/$defs/foo/properties/a 189 + // https://my.schema.org/hello#/$defs/foo https://my.schema.org/hello#/$defs/foo 190 + // https://other.org https://my.schema.org/hello#/$defs/foo 191 + // https://external.ref <nil> 192 + // 193 + // It will also be called for the named schema in #/$defs/foo with these arguments: 194 + // 195 + // https://other.org https://my.schema.org/hello#/$defs/foo 196 + // 197 + // MapRef should return the desired CUE location for the schema with 198 + // the provided IDs, consisting of the import path of the package 199 + // containing the schema, and a path within that package. If the 200 + // returned import path is empty, the path will be interpreted 201 + // relative to the root of the generated JSON schema. 202 + // 203 + // Note that MapRef is general enough to subsume use of [Config.Map] and 204 + // [Config.MapURL], which are both now deprecated. If all three fields are 205 + // nil, [DefaultMapRef] will be used. 206 + MapRef func(loc SchemaLoc) (importPath string, relPath cue.Path, err error) 207 + 105 208 // TODO: configurability to make it compatible with OpenAPI, such as 106 209 // - locations of definitions: #/components/schemas, for instance. 107 210 // - selection and definition of formats ··· 126 229 DefaultVersion Version 127 230 128 231 _ struct{} // prohibit casting from different type. 232 + } 233 + 234 + // SchemaLoc defines the location of schema, both in absolute 235 + // terms as its canonical ID and, optionally, relative to the 236 + // root of the value passed to [Extract]. 237 + type SchemaLoc struct { 238 + // ID holds the canonical URI of the schema, as declared 239 + // by the schema or one of its parents. 240 + ID *url.URL 241 + 242 + // IsLocal holds whether the schema has been defined locally. 243 + // If true, then [SchemaLoc.Path] holds the path from the root 244 + // value, as passed to [Extract], to the schema definition. 245 + IsLocal bool 246 + Path cue.Path 247 + } 248 + 249 + func (loc SchemaLoc) String() string { 250 + if loc.IsLocal { 251 + return fmt.Sprintf("id=%v localPath=%v", loc.ID, loc.Path) 252 + } 253 + return fmt.Sprintf("id=%v", loc.ID) 129 254 } 130 255 131 256 func ref[T any](x T) *T {
+45
encoding/jsonschema/pointer.go
··· 1 + package jsonschema 2 + 3 + import "strings" 4 + 5 + // TODO this file contains functionality that mimics the JSON Pointer functionality 6 + // in https://pkg.go.dev/github.com/go-json-experiment/json/jsontext#Pointer; 7 + // perhaps use it when it moves into the stdlib as json/v2. 8 + 9 + var ( 10 + jsonPtrEsc = strings.NewReplacer("~", "~0", "/", "~1") 11 + jsonPtrUnesc = strings.NewReplacer("~0", "~", "~1", "/") 12 + ) 13 + 14 + // TODO(go1.23) func jsonPointerFromTokens(tokens iter.Seq[string]) string 15 + func jsonPointerFromTokens(tokens func(func(string) bool)) string { 16 + var buf strings.Builder 17 + // TODO for tok := range tokens { 18 + tokens(func(tok string) bool { 19 + buf.WriteByte('/') 20 + buf.WriteString(jsonPtrEsc.Replace(tok)) 21 + return true 22 + }) 23 + return buf.String() 24 + } 25 + 26 + // TODO(go1.23) func jsonPointerTokens(p string) iter.Seq[string] 27 + func jsonPointerTokens(p string) func(func(string) bool) { 28 + return func(yield func(string) bool) { 29 + needUnesc := strings.IndexByte(p, '~') >= 0 30 + for len(p) > 0 { 31 + p = strings.TrimPrefix(p, "/") 32 + i := min(uint(strings.IndexByte(p, '/')), uint(len(p))) 33 + var ok bool 34 + if needUnesc { 35 + ok = yield(jsonPtrUnesc.Replace(p[:i])) 36 + } else { 37 + ok = yield(p[:i]) 38 + } 39 + if !ok { 40 + return 41 + } 42 + p = p[i:] 43 + } 44 + } 45 + }
+133 -321
encoding/jsonschema/ref.go
··· 15 15 package jsonschema 16 16 17 17 import ( 18 + "encoding/base64" 18 19 "fmt" 19 20 "net/url" 20 21 "path" ··· 26 27 "cuelang.org/go/cue/errors" 27 28 "cuelang.org/go/cue/token" 28 29 "cuelang.org/go/internal" 29 - "cuelang.org/go/mod/module" 30 30 ) 31 31 32 - func (d *decoder) parseRef(p token.Pos, str string) []string { 32 + func parseRootRef(str string) (cue.Path, error) { 33 33 u, err := url.Parse(str) 34 34 if err != nil { 35 - d.addErr(errors.Newf(p, "invalid JSON reference: %s", err)) 36 - return nil 35 + return cue.Path{}, fmt.Errorf("invalid JSON reference: %s", err) 37 36 } 38 - 39 - if u.Host != "" || u.Path != "" { 40 - d.addErr(errors.Newf(p, "external references (%s) not supported in Root", str)) 41 - // TODO: handle 42 - // host: 43 - // If the host corresponds to a package known to cue, 44 - // load it from there. It would prefer schema converted to 45 - // CUE, although we could consider loading raw JSON schema 46 - // if present. 47 - // If not present, advise the user to run cue get. 48 - // path: 49 - // Look up on file system or relatively to authority location. 50 - return nil 37 + if u.Host != "" || u.Path != "" || u.Opaque != "" { 38 + return cue.Path{}, fmt.Errorf("external references (%s) not supported in Root", str) 51 39 } 52 - fragmentParts, err := splitFragment(u) 53 - if err != nil { 54 - d.addErr(errors.Newf(p, "%v", err)) 55 - return nil 40 + // As a special case for backward compatibility, treat 41 + // trim a final slash because the docs specifically 42 + // mention that #/ refers to the root document 43 + // and the openapi code uses #/components/schemas/. 44 + // (technically a trailing slash `/` means there's an empty 45 + // final element). 46 + u.Fragment = strings.TrimSuffix(u.Fragment, "/") 47 + fragmentParts := collectSlice(jsonPointerTokens(u.Fragment)) 48 + var selectors []cue.Selector 49 + for _, r := range fragmentParts { 50 + // Technically this is incorrect because a numeric 51 + // element could also index into a list, but the 52 + // resulting CUE path will not allow that. 53 + selectors = append(selectors, cue.Str(r)) 56 54 } 57 - return fragmentParts 55 + return cue.MakePath(selectors...), nil 58 56 } 59 57 60 - // resolveURI parses a URI from n and resolves it in the current context. 58 + var errRefNotFound = errors.New("JSON Pointer reference not found") 59 + 60 + func lookupJSONPointer(v cue.Value, p string) (_ cue.Value, _err error) { 61 + // TODO(go1.23) for part := range jsonPointerTokens(p) 62 + jsonPointerTokens(p)(func(part string) bool { 63 + // Note: a JSON Pointer doesn't distinguish between indexing 64 + // and struct lookup. We have to use the value itself to decide 65 + // which operation is appropriate. 66 + v, _ = v.Default() 67 + switch v.Kind() { 68 + case cue.StructKind: 69 + v = v.LookupPath(cue.MakePath(cue.Str(part))) 70 + case cue.ListKind: 71 + idx := int64(0) 72 + if len(part) > 1 && part[0] == '0' { 73 + // Leading zeros are not allowed 74 + _err = errRefNotFound 75 + return false 76 + } 77 + idx, err := strconv.ParseInt(part, 10, 64) 78 + if err != nil { 79 + _err = errRefNotFound 80 + return false 81 + } 82 + v = v.LookupPath(cue.MakePath(cue.Index(idx))) 83 + } 84 + if !v.Exists() { 85 + _err = errRefNotFound 86 + return false 87 + } 88 + return true 89 + }) 90 + return v, _err 91 + } 92 + 93 + func sameSchemaRoot(u1, u2 *url.URL) bool { 94 + return u1.Host == u2.Host && u1.Path == u2.Path && u1.Opaque == u2.Opaque 95 + } 96 + 97 + // resolveURI parses a URI from s and resolves it in the current context. 61 98 // To resolve it in the current context, it looks for the closest URI from 62 99 // an $id in the parent scopes and the uses the URI resolution to get the 63 100 // new URI. ··· 75 112 return nil 76 113 } 77 114 78 - for ; s != nil; s = s.up { 79 - if s.id != nil { 80 - u = s.id.ResolveReference(u) 81 - break 82 - } 83 - } 84 - 85 - return u 86 - } 87 - 88 - // makeCUERef converts a URI into a CUE reference for the current location. 89 - // The returned identifier (or first expression in a selection chain), is 90 - // hardwired to point to the resolved value. This will allow [astutil.Sanitize] 91 - // to automatically unshadow any shadowed variables. 92 - func (s *state) makeCUERef(n cue.Value, u *url.URL, fragmentParts []string) ast.Expr { 93 - if fn := s.cfg.Map; fn != nil { 94 - // TODO: This block is only used in case s.cfg.Map is set, which is 95 - // currently only used for OpenAPI. Handling should be brought more in 96 - // line with JSON schema. 97 - a, err := fn(n.Pos(), fragmentParts) 98 - if err != nil { 99 - s.addErr(errors.Newf(n.Pos(), "invalid reference %q: %v", u, err)) 115 + if u.IsAbs() { 116 + // Absolute URI: no need to walk up the tree. 117 + if u.Host == DefaultRootIDHost { 118 + // No-one should be using the default root ID explicitly. 119 + s.errf(n, "invalid use of default root ID host (%v) in URI", DefaultRootIDHost) 100 120 return nil 101 121 } 102 - if len(a) == 0 { 103 - // TODO: should we allow inserting at root level? 104 - s.addErr(errors.Newf(n.Pos(), 105 - "invalid empty reference returned by map for %q", u)) 106 - return nil 107 - } 108 - sel, ok := a[0].(ast.Expr) 109 - if !ok { 110 - sel = &ast.BadExpr{} 111 - } 112 - for _, l := range a[1:] { 113 - switch x := l.(type) { 114 - case *ast.Ident: 115 - sel = &ast.SelectorExpr{X: sel, Sel: x} 116 - 117 - case *ast.BasicLit: 118 - sel = &ast.IndexExpr{X: sel, Index: x} 119 - } 120 - } 121 - return sel 122 - } 123 - 124 - for ; s.up != nil; s = s.up { 125 - if s.id == nil || s.id.Host != u.Host || s.id.Path != u.Path { 126 - continue 127 - } 128 - if len(fragmentParts) > 0 { 129 - ident, fragmentParts0 := s.getNextIdent(n.Pos(), fragmentParts) 130 - ident.Node = s.obj 131 - return s.newSel(n.Pos(), ident, fragmentParts0) 132 - } 133 - if len(s.idRef) == 0 { 134 - // This is a reference to either root or a schema for which 135 - // we do not yet support references. See Issue #386. 136 - if s.up.up != nil { 137 - s.errf(n, "cannot refer to internal schema %q", u) 138 - return nil 139 - } 140 - 141 - // This is referring to the root scope. There is a dummy 142 - // state above the root state that we need to update. 143 - s = s.up 144 - 145 - // Refers to the top of the file. 146 - return s.rootRef() 147 - } 148 - x := s.idRef[0] 149 - if !x.isDef && !ast.IsValidIdent(x.name) { 150 - s.errf(n, "id %q not supported", x.name) 151 - return nil 152 - } 153 - e := ast.NewIdent(x.name) 154 - if len(s.idRef) == 1 { 155 - return e 156 - } 157 - return newSel(e, s.idRef[1]) 158 - } 159 - var refExpr ast.Expr 160 - switch { 161 - case u.Host == "" && u.Path == "", 162 - s.id != nil && s.id.Host == u.Host && s.id.Path == u.Path: 163 - if len(fragmentParts) == 0 { 164 - // Refers to the top of the file. 165 - return s.rootRef() 166 - } 167 - 168 - refExpr, fragmentParts = s.getNextIdent(n.Pos(), fragmentParts) 169 - 170 - case u.Host != "": 171 - // Reference not found within scope. Create an import reference. 172 - 173 - // TODO: currently only $ids that are in scope can be 174 - // referenced. We could consider doing an extra pass to record 175 - // all '$id's in a file to be able to link to them even if they 176 - // are not in scope. 177 - importPath, refPath, err := s.cfg.MapURL(u) 178 - if err != nil { 179 - ustr := u.String() 180 - // Avoid producing many errors for the same URL. 181 - if !s.mapURLErrors[ustr] { 182 - s.mapURLErrors[ustr] = true 183 - s.errf(n, "cannot determine import path from URL %q: %v", ustr, err) 184 - } 185 - return nil 186 - } 187 - ip := module.ParseImportPath(importPath) 188 - if ip.Qualifier == "" { 189 - s.errf(n, "cannot determine package name from import path %q", importPath) 190 - return nil 191 - } 192 - ident := ast.NewIdent(ip.Qualifier) 193 - ident.Node = &ast.ImportSpec{Path: ast.NewString(importPath)} 194 - refExpr, err = pathRefSyntax(refPath, ident) 195 - if err != nil { 196 - s.errf(n, "invalid CUE path for URL %q: %v", u, err) 197 - return nil 198 - } 199 - 200 - default: 201 - // Just a path, not sure what that means. 202 - s.errf(n, "unknown domain for reference %q", u) 203 - return nil 204 - } 205 - return s.newSel(n.Pos(), refExpr, fragmentParts) 206 - } 207 - 208 - // getNextSelector translates a JSON Reference path into a CUE path by consuming 209 - // the first path elements and returning the corresponding CUE label. 210 - func (s *state) getNextSelector(pos token.Pos, a []string) (l label, tail []string) { 211 - switch elem := a[0]; elem { 212 - case "$defs", "definitions": 213 - if len(a) == 1 { 214 - s.warnf(pos, "cannot refer to %s section: must refer to one of its elements", a[0]) 215 - return label{}, nil 216 - } 217 - 218 - if name := "#" + a[1]; ast.IsValidIdent(name) { 219 - return label{name, true}, a[2:] 220 - } 221 - 222 - return label{"#", true}, a[1:] 223 - 224 - case "properties": 225 - if len(a) == 1 { 226 - s.warnf(pos, "cannot refer to %s section: must refer to one of its elements", a[0]) 227 - return label{}, nil 228 - } 229 - 230 - return label{a[1], false}, a[2:] 231 - 232 - case "additionalProperties", 233 - "patternProperties", 234 - "items", 235 - "additionalItems": 236 - // TODO: as a temporary workaround, include the schema verbatim. 237 - // TODO: provide definitions for these in CUE. 238 - s.warnf(pos, "referring to field %q not yet supported", elem) 239 - 240 - // Other known fields cannot be supported. 241 - return label{}, nil 242 - 243 - default: 244 - return label{elem, false}, a[1:] 122 + return u 245 123 } 246 - } 247 124 248 - // newSel converts an initial CUE identifier and a relative JSON Reference path 249 - // to a CUE selection path. 250 - func (s *state) newSel(pos token.Pos, e ast.Expr, a []string) ast.Expr { 251 - for len(a) > 0 { 252 - var label label 253 - label, a = s.getNextSelector(pos, a) 254 - e = newSel(e, label) 255 - } 256 - return e 257 - } 258 - 259 - // newSel converts label to a CUE index and creates an expression to index 260 - // into e. 261 - func newSel(e ast.Expr, label label) ast.Expr { 262 - if label.isDef { 263 - return ast.NewSel(e, label.name) 264 - 265 - } 266 - if ast.IsValidIdent(label.name) && !internal.IsDefOrHidden(label.name) { 267 - return ast.NewSel(e, label.name) 268 - } 269 - return &ast.IndexExpr{X: e, Index: ast.NewString(label.name)} 270 - } 271 - 272 - func (s *state) setField(lab label, f *ast.Field) { 273 - x := s.getRef(lab) 274 - x.field = f 275 - s.setRef(lab, x) 276 - x = s.getRef(lab) 125 + // TODO(go1.23) use ResolveReference directly. 126 + return resolveReference(s.schemaRoot().id, u) 277 127 } 278 128 279 - func (s *state) getRef(lab label) refs { 280 - if s.fieldRefs == nil { 281 - s.fieldRefs = make(map[label]refs) 282 - } 283 - x, ok := s.fieldRefs[lab] 284 - if !ok { 285 - if lab.isDef || 286 - (ast.IsValidIdent(lab.name) && !internal.IsDefOrHidden(lab.name)) { 287 - x.ident = lab.name 288 - } else { 289 - x.ident = "_X" + strconv.Itoa(s.decoder.numID) 290 - s.decoder.numID++ 129 + // schemaRoot returns the state for the nearest enclosing 130 + // schema that has its own schema ID. 131 + func (s *state) schemaRoot() *state { 132 + for ; s != nil; s = s.up { 133 + if s.id != nil { 134 + return s 291 135 } 292 - s.fieldRefs[lab] = x 293 136 } 294 - return x 137 + // Should never happen, as we ensure there's always an absolute 138 + // URI at the root. 139 + panic("unreachable") 295 140 } 296 141 297 - func (s *state) setRef(lab label, r refs) { 298 - s.fieldRefs[lab] = r 142 + // DefaultMapRef implements the default logic for mapping a schema location 143 + // to CUE. 144 + // It uses a heuristic to map the URL host and path to an import path, 145 + // and maps the fragment part according to the following: 146 + // 147 + // # <empty path> 148 + // #/definitions/foo #foo or #."foo" 149 + // #/$defs/foo #foo or #."foo" 150 + func DefaultMapRef(loc SchemaLoc) (importPath string, path cue.Path, err error) { 151 + return defaultMapRef(loc, defaultMap, DefaultMapURL) 299 152 } 300 153 301 - // getNextIdent gets the first CUE reference from a JSON Reference path and 302 - // converts it to a CUE identifier. 303 - func (s *state) getNextIdent(pos token.Pos, a []string) (resolved *ast.Ident, tail []string) { 304 - lab, a := s.getNextSelector(pos, a) 305 - 306 - x := s.getRef(lab) 307 - ident := ast.NewIdent(x.ident) 308 - x.refs = append(x.refs, ident) 309 - s.setRef(lab, x) 310 - 311 - return ident, a 312 - } 313 - 314 - // linkReferences resolves identifiers to relevant nodes. This allows 315 - // [astutil.Sanitize] to unshadow nodes if necessary. 316 - func (s *state) linkReferences() { 317 - for _, r := range s.fieldRefs { 318 - if r.field == nil { 319 - // TODO: improve error message. 320 - s.errf(cue.Value{}, "reference to non-existing value %q", r.ident) 321 - continue 322 - } 323 - 324 - // link resembles the link value. See astutil.Resolve. 325 - var link ast.Node 326 - 327 - ident, ok := r.field.Label.(*ast.Ident) 328 - if ok && ident.Name == r.ident { 329 - link = r.field.Value 330 - } else if len(r.refs) > 0 { 331 - r.field.Label = &ast.Alias{ 332 - Ident: ast.NewIdent(r.ident), 333 - Expr: r.field.Label.(ast.Expr), 334 - } 335 - link = r.field 336 - } 337 - 338 - for _, i := range r.refs { 339 - i.Node = link 154 + // defaultMapRef implements the default MapRef semantics 155 + // in terms of the default Map and MapURL functions provided 156 + // in the configuration. 157 + func defaultMapRef( 158 + loc SchemaLoc, 159 + mapFn func(pos token.Pos, path []string) ([]ast.Label, error), 160 + mapURLFn func(u *url.URL) (importPath string, path cue.Path, err error), 161 + ) (importPath string, path cue.Path, err error) { 162 + var fragment string 163 + if loc.IsLocal { 164 + fragment = cuePathToJSONPointer(loc.Path) 165 + } else { 166 + // It's external: use mapURLFn. 167 + u := ref(*loc.ID) 168 + fragment = loc.ID.Fragment 169 + u.Fragment = "" 170 + var err error 171 + importPath, path, err = mapURLFn(u) 172 + if err != nil { 173 + return "", cue.Path{}, err 340 174 } 341 175 } 342 - } 343 - 344 - // splitFragment splits the fragment part of a URI into path components 345 - // and removes the fragment part from u. 346 - // The result may be an empty slice. 347 - // 348 - // TODO: use u.RawFragment so that we can accept field names 349 - // that contain `/` characters. 350 - func splitFragment(u *url.URL) ([]string, error) { 351 - frag := u.EscapedFragment() 352 - if frag == "" { 353 - return nil, nil 176 + if len(fragment) > 0 && fragment[0] != '/' { 177 + return "", cue.Path{}, fmt.Errorf("anchors (%s) not supported", fragment) 354 178 } 355 - if !strings.HasPrefix(frag, "/") { 356 - return nil, fmt.Errorf("anchors (%s) not supported", frag) 179 + parts := collectSlice(jsonPointerTokens(fragment)) 180 + labels, err := mapFn(token.Pos{}, parts) 181 + if err != nil { 182 + return "", cue.Path{}, err 357 183 } 358 - u.Fragment = "" 359 - u.RawFragment = "" 360 - 361 - if s := strings.TrimRight(frag[1:], "/"); s != "" { 362 - return strings.Split(s, "/"), nil 184 + relPath, err := labelsToCUEPath(labels) 185 + if err != nil { 186 + return "", cue.Path{}, err 363 187 } 364 - return nil, nil 188 + return importPath, pathConcat(path, relPath), nil 365 189 } 366 190 367 - func (d *decoder) mapRef(p token.Pos, str string, ref []string) []ast.Label { 368 - fn := d.cfg.Map 369 - if fn == nil { 370 - fn = jsonSchemaRef 371 - } 372 - a, err := fn(p, ref) 373 - if err != nil { 374 - if str == "" { 375 - str = "#/" + strings.Join(ref, "/") 376 - } 377 - d.addErr(errors.Newf(p, "invalid reference %q: %v", str, err)) 378 - return nil 379 - } 191 + func defaultMap(p token.Pos, a []string) ([]ast.Label, error) { 380 192 if len(a) == 0 { 381 - // TODO: should we allow inserting at root level? 382 - if str == "" { 383 - str = "#/" + strings.Join(ref, "/") 384 - } 385 - d.addErr(errors.Newf(p, 386 - "invalid empty reference returned by map for %q", str)) 387 - return nil 193 + return nil, nil 388 194 } 389 - return a 390 - } 391 - 392 - func jsonSchemaRef(p token.Pos, a []string) ([]ast.Label, error) { 393 195 // TODO: technically, references could reference a 394 196 // non-definition. We disallow this case for the standard 395 197 // JSON Schema interpretation. We could detect cases that 396 198 // are not definitions and then resolve those as literal 397 199 // values. 398 200 if len(a) != 2 || (a[0] != "definitions" && a[0] != "$defs") { 399 - return nil, errors.Newf(p, 400 - // Don't mention the ability to use $defs, as this definition seems 401 - // to already have been withdrawn from the JSON Schema spec. 402 - "$ref must be of the form #/definitions/...") 201 + // It's an internal reference (or a nested definition reference). 202 + // Fall back to defining it in the internal namespace. 203 + // TODO this is needlessly inefficient, as we're putting something 204 + // back together that was already joined before defaultMap was 205 + // invoked. This does avoid dual implementations though. 206 + p := jsonPointerFromTokens(sliceValues(a)) 207 + return []ast.Label{ast.NewIdent("_#defs"), ast.NewString(p)}, nil 403 208 } 404 209 name := a[1] 405 210 if ast.IsValidIdent(name) && ··· 414 219 // path mapping. It trims off any ".json" suffix and uses the 415 220 // package name "schema" if the final component of the path 416 221 // isn't a valid CUE identifier. 222 + // 223 + // Deprecated: The [Config.MapURL] API is superceded in 224 + // factor of [Config.MapRef]. 417 225 func DefaultMapURL(u *url.URL) (string, cue.Path, error) { 418 226 p := u.Path 419 227 base := path.Base(p) ··· 425 233 base = "schema" 426 234 } 427 235 p += ":" + base 236 + } 237 + if u.Opaque != "" { 238 + // TODO don't use base64 unless we really have to. 239 + return base64.RawURLEncoding.EncodeToString([]byte(u.Opaque)), cue.Path{}, nil 428 240 } 429 241 return u.Host + p, cue.Path{}, nil 430 242 }
+174
encoding/jsonschema/resolveref_v.1.22_test.go
··· 1 + package jsonschema 2 + 3 + import ( 4 + stdurl "net/url" 5 + "testing" 6 + ) 7 + 8 + // These tests are copied from net/url and are here just 9 + // to sanity-check that our temporary fix ResolveReference 10 + // implementation actually works correctly. 11 + // TODO(go1.23) remove this file 12 + 13 + var resolveReferenceTests = []struct { 14 + base, rel, expected string 15 + }{ 16 + // Absolute URL references 17 + {"http://foo.com?a=b", "https://bar.com/", "https://bar.com/"}, 18 + {"http://foo.com/", "https://bar.com/?a=b", "https://bar.com/?a=b"}, 19 + {"http://foo.com/", "https://bar.com/?", "https://bar.com/?"}, 20 + {"http://foo.com/bar", "mailto:foo@example.com", "mailto:foo@example.com"}, 21 + 22 + // Path-absolute references 23 + {"http://foo.com/bar", "/baz", "http://foo.com/baz"}, 24 + {"http://foo.com/bar?a=b#f", "/baz", "http://foo.com/baz"}, 25 + {"http://foo.com/bar?a=b", "/baz?", "http://foo.com/baz?"}, 26 + {"http://foo.com/bar?a=b", "/baz?c=d", "http://foo.com/baz?c=d"}, 27 + 28 + // Multiple slashes 29 + {"http://foo.com/bar", "http://foo.com//baz", "http://foo.com//baz"}, 30 + {"http://foo.com/bar", "http://foo.com///baz/quux", "http://foo.com///baz/quux"}, 31 + 32 + // Scheme-relative 33 + {"https://foo.com/bar?a=b", "//bar.com/quux", "https://bar.com/quux"}, 34 + 35 + // Path-relative references: 36 + 37 + // ... current directory 38 + {"http://foo.com", ".", "http://foo.com/"}, 39 + {"http://foo.com/bar", ".", "http://foo.com/"}, 40 + {"http://foo.com/bar/", ".", "http://foo.com/bar/"}, 41 + 42 + // ... going down 43 + {"http://foo.com", "bar", "http://foo.com/bar"}, 44 + {"http://foo.com/", "bar", "http://foo.com/bar"}, 45 + {"http://foo.com/bar/baz", "quux", "http://foo.com/bar/quux"}, 46 + 47 + // ... going up 48 + {"http://foo.com/bar/baz", "../quux", "http://foo.com/quux"}, 49 + {"http://foo.com/bar/baz", "../../../../../quux", "http://foo.com/quux"}, 50 + {"http://foo.com/bar", "..", "http://foo.com/"}, 51 + {"http://foo.com/bar/baz", "./..", "http://foo.com/"}, 52 + // ".." in the middle (issue 3560) 53 + {"http://foo.com/bar/baz", "quux/dotdot/../tail", "http://foo.com/bar/quux/tail"}, 54 + {"http://foo.com/bar/baz", "quux/./dotdot/../tail", "http://foo.com/bar/quux/tail"}, 55 + {"http://foo.com/bar/baz", "quux/./dotdot/.././tail", "http://foo.com/bar/quux/tail"}, 56 + {"http://foo.com/bar/baz", "quux/./dotdot/./../tail", "http://foo.com/bar/quux/tail"}, 57 + {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/././../../tail", "http://foo.com/bar/quux/tail"}, 58 + {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/./.././../tail", "http://foo.com/bar/quux/tail"}, 59 + {"http://foo.com/bar/baz", "quux/./dotdot/dotdot/dotdot/./../../.././././tail", "http://foo.com/bar/quux/tail"}, 60 + {"http://foo.com/bar/baz", "quux/./dotdot/../dotdot/../dot/./tail/..", "http://foo.com/bar/quux/dot/"}, 61 + 62 + // Remove any dot-segments prior to forming the target URI. 63 + // https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4 64 + {"http://foo.com/dot/./dotdot/../foo/bar", "../baz", "http://foo.com/dot/baz"}, 65 + 66 + // Triple dot isn't special 67 + {"http://foo.com/bar", "...", "http://foo.com/..."}, 68 + 69 + // Fragment 70 + {"http://foo.com/bar", ".#frag", "http://foo.com/#frag"}, 71 + {"http://example.org/", "#!$&%27()*+,;=", "http://example.org/#!$&%27()*+,;="}, 72 + 73 + // Paths with escaping (issue 16947). 74 + {"http://foo.com/foo%2fbar/", "../baz", "http://foo.com/baz"}, 75 + {"http://foo.com/1/2%2f/3%2f4/5", "../../a/b/c", "http://foo.com/1/a/b/c"}, 76 + {"http://foo.com/1/2/3", "./a%2f../../b/..%2fc", "http://foo.com/1/2/b/..%2fc"}, 77 + {"http://foo.com/1/2%2f/3%2f4/5", "./a%2f../b/../c", "http://foo.com/1/2%2f/3%2f4/a%2f../c"}, 78 + {"http://foo.com/foo%20bar/", "../baz", "http://foo.com/baz"}, 79 + {"http://foo.com/foo", "../bar%2fbaz", "http://foo.com/bar%2fbaz"}, 80 + {"http://foo.com/foo%2dbar/", "./baz-quux", "http://foo.com/foo%2dbar/baz-quux"}, 81 + 82 + // RFC 3986: Normal Examples 83 + // https://datatracker.ietf.org/doc/html/rfc3986#section-5.4.1 84 + {"http://a/b/c/d;p?q", "g:h", "g:h"}, 85 + {"http://a/b/c/d;p?q", "g", "http://a/b/c/g"}, 86 + {"http://a/b/c/d;p?q", "./g", "http://a/b/c/g"}, 87 + {"http://a/b/c/d;p?q", "g/", "http://a/b/c/g/"}, 88 + {"http://a/b/c/d;p?q", "/g", "http://a/g"}, 89 + {"http://a/b/c/d;p?q", "//g", "http://g"}, 90 + {"http://a/b/c/d;p?q", "?y", "http://a/b/c/d;p?y"}, 91 + {"http://a/b/c/d;p?q", "g?y", "http://a/b/c/g?y"}, 92 + {"http://a/b/c/d;p?q", "#s", "http://a/b/c/d;p?q#s"}, 93 + {"http://a/b/c/d;p?q", "g#s", "http://a/b/c/g#s"}, 94 + {"http://a/b/c/d;p?q", "g?y#s", "http://a/b/c/g?y#s"}, 95 + {"http://a/b/c/d;p?q", ";x", "http://a/b/c/;x"}, 96 + {"http://a/b/c/d;p?q", "g;x", "http://a/b/c/g;x"}, 97 + {"http://a/b/c/d;p?q", "g;x?y#s", "http://a/b/c/g;x?y#s"}, 98 + {"http://a/b/c/d;p?q", "", "http://a/b/c/d;p?q"}, 99 + {"http://a/b/c/d;p?q", ".", "http://a/b/c/"}, 100 + {"http://a/b/c/d;p?q", "./", "http://a/b/c/"}, 101 + {"http://a/b/c/d;p?q", "..", "http://a/b/"}, 102 + {"http://a/b/c/d;p?q", "../", "http://a/b/"}, 103 + {"http://a/b/c/d;p?q", "../g", "http://a/b/g"}, 104 + {"http://a/b/c/d;p?q", "../..", "http://a/"}, 105 + {"http://a/b/c/d;p?q", "../../", "http://a/"}, 106 + {"http://a/b/c/d;p?q", "../../g", "http://a/g"}, 107 + 108 + // RFC 3986: Abnormal Examples 109 + // https://datatracker.ietf.org/doc/html/rfc3986#section-5.4.2 110 + {"http://a/b/c/d;p?q", "../../../g", "http://a/g"}, 111 + {"http://a/b/c/d;p?q", "../../../../g", "http://a/g"}, 112 + {"http://a/b/c/d;p?q", "/./g", "http://a/g"}, 113 + {"http://a/b/c/d;p?q", "/../g", "http://a/g"}, 114 + {"http://a/b/c/d;p?q", "g.", "http://a/b/c/g."}, 115 + {"http://a/b/c/d;p?q", ".g", "http://a/b/c/.g"}, 116 + {"http://a/b/c/d;p?q", "g..", "http://a/b/c/g.."}, 117 + {"http://a/b/c/d;p?q", "..g", "http://a/b/c/..g"}, 118 + {"http://a/b/c/d;p?q", "./../g", "http://a/b/g"}, 119 + {"http://a/b/c/d;p?q", "./g/.", "http://a/b/c/g/"}, 120 + {"http://a/b/c/d;p?q", "g/./h", "http://a/b/c/g/h"}, 121 + {"http://a/b/c/d;p?q", "g/../h", "http://a/b/c/h"}, 122 + {"http://a/b/c/d;p?q", "g;x=1/./y", "http://a/b/c/g;x=1/y"}, 123 + {"http://a/b/c/d;p?q", "g;x=1/../y", "http://a/b/c/y"}, 124 + {"http://a/b/c/d;p?q", "g?y/./x", "http://a/b/c/g?y/./x"}, 125 + {"http://a/b/c/d;p?q", "g?y/../x", "http://a/b/c/g?y/../x"}, 126 + {"http://a/b/c/d;p?q", "g#s/./x", "http://a/b/c/g#s/./x"}, 127 + {"http://a/b/c/d;p?q", "g#s/../x", "http://a/b/c/g#s/../x"}, 128 + 129 + // Extras. 130 + {"https://a/b/c/d;p?q", "//g?q", "https://g?q"}, 131 + {"https://a/b/c/d;p?q", "//g#s", "https://g#s"}, 132 + {"https://a/b/c/d;p?q", "//g/d/e/f?y#s", "https://g/d/e/f?y#s"}, 133 + {"https://a/b/c/d;p#s", "?y", "https://a/b/c/d;p?y"}, 134 + {"https://a/b/c/d;p?q#s", "?y", "https://a/b/c/d;p?y"}, 135 + 136 + // Empty path and query but with ForceQuery (issue 46033). 137 + {"https://a/b/c/d;p?q#s", "?", "https://a/b/c/d;p?"}, 138 + 139 + // Opaque URLs (issue 66084). 140 + {"https://foo.com/bar?a=b", "http:opaque", "http:opaque"}, 141 + {"http:opaque?x=y#zzz", "https:/foo?a=b#frag", "https:/foo?a=b#frag"}, 142 + {"http:opaque?x=y#zzz", "https:foo:bar", "https:foo:bar"}, 143 + {"http:opaque?x=y#zzz", "https:bar/baz?a=b#frag", "https:bar/baz?a=b#frag"}, 144 + {"http:opaque?x=y#zzz", "https://user@host:1234?a=b#frag", "https://user@host:1234?a=b#frag"}, 145 + {"http:opaque?x=y#zzz", "?a=b#frag", "http:opaque?a=b#frag"}, 146 + } 147 + 148 + func TestResolveReference(t *testing.T) { 149 + mustParse := func(url string) *stdurl.URL { 150 + u, err := stdurl.Parse(url) 151 + if err != nil { 152 + t.Fatalf("Parse(%q) got err %v", url, err) 153 + } 154 + return u 155 + } 156 + opaque := &stdurl.URL{Scheme: "scheme", Opaque: "opaque"} 157 + for _, test := range resolveReferenceTests { 158 + base := mustParse(test.base) 159 + rel := mustParse(test.rel) 160 + url := resolveReference(base, rel) 161 + if got := url.String(); got != test.expected { 162 + t.Errorf("URL(%q).ResolveReference(%q)\ngot %q\nwant %q", test.base, test.rel, got, test.expected) 163 + } 164 + // Ensure that new instances are returned. 165 + if base == url { 166 + t.Errorf("Expected URL.ResolveReference to return new URL instance.") 167 + } 168 + // Ensure Opaque resets the URL. 169 + url = resolveReference(base, opaque) 170 + if *url != *opaque { 171 + t.Errorf("ResolveReference failed to resolve opaque URL:\ngot %#v\nwant %#v", url, opaque) 172 + } 173 + } 174 + }
+46
encoding/jsonschema/resolveref_v1.22.go
··· 1 + //go:build !go1.23 2 + 3 + package jsonschema 4 + 5 + import "net/url" 6 + 7 + // resolveReference is exactly like [url.URL.ResolveReference] 8 + // except that it fixes https://go.dev/issue/66084, which 9 + // has been fixed in Go 1.23 (https://go.dev/cl/572915) but not go1.22 10 + // TODO(go1.23) remove this and use ResolveReference directly] 11 + func resolveReference(u, ref *url.URL) *url.URL { 12 + if !hitsBug(u, ref) { 13 + return u.ResolveReference(ref) 14 + } 15 + url := *ref 16 + if ref.Scheme == "" { 17 + url.Scheme = u.Scheme 18 + } 19 + if ref.Path == "" && !ref.ForceQuery && ref.RawQuery == "" { 20 + url.RawQuery = u.RawQuery 21 + if ref.Fragment == "" { 22 + url.Fragment = u.Fragment 23 + url.RawFragment = u.RawFragment 24 + } 25 + } 26 + url.Opaque = u.Opaque 27 + url.User = nil 28 + url.Host = "" 29 + url.Path = "" 30 + return &url 31 + } 32 + 33 + // This mirrors the structure of the stdlib [url.URL.ResolveReference] 34 + // method. 35 + func hitsBug(u, ref *url.URL) bool { 36 + if ref.Scheme != "" || ref.Host != "" || ref.User != nil { 37 + return false 38 + } 39 + if ref.Opaque != "" { 40 + return false 41 + } 42 + if ref.Path == "" && u.Opaque != "" { 43 + return true 44 + } 45 + return false 46 + }
+11
encoding/jsonschema/resolveref_v1.23.go
··· 1 + //go:build go1.23 2 + 3 + // TODO(go1.12) remove this file. 4 + 5 + package jsonschema 6 + 7 + import "net/url" 8 + 9 + func resolveReference(u, ref *url.URL) *url.URL { 10 + return u.ResolveReference(ref) 11 + }
+1
encoding/jsonschema/structbuilder.go
··· 250 250 } 251 251 return decls 252 252 } 253 + 253 254 func appendField(decls []ast.Decl, path cue.Path, v ast.Expr, comment *ast.CommentGroup) ([]ast.Decl, error) { 254 255 if len(path.Selectors()) == 0 { 255 256 return appendDeclsExpr(decls, v), nil
+6 -6
encoding/jsonschema/testdata/external/tests/draft2019-09/additionalItems.json
··· 103 103 "data": [], 104 104 "valid": true, 105 105 "skip": { 106 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:45\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 107 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:45\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:2:33\n" 106 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:45\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 107 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:45\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:3:33\n" 108 108 } 109 109 }, 110 110 { ··· 114 114 ], 115 115 "valid": true, 116 116 "skip": { 117 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:45\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 118 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:45\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:2:33\n" 117 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:45\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 118 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:45\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:3:33\n" 119 119 } 120 120 }, 121 121 { ··· 126 126 ], 127 127 "valid": true, 128 128 "skip": { 129 - "v2": "5 errors in empty disjunction:\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:45\n instance.json:1:1\nconflicting values bool and [1,2] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1,2] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1,2] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1,2] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 130 - "v3": "conflicting values [1,2] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1,2] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1,2] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1,2] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:2:45\n instance.json:1:1\nincompatible list lengths (2 and 3):\n generated.cue:2:33\n" 129 + "v2": "5 errors in empty disjunction:\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:45\n instance.json:1:1\nconflicting values bool and [1,2] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1,2] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1,2] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1,2] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 130 + "v3": "conflicting values [1,2] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1,2] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1,2] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1,2] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:3:45\n instance.json:1:1\nincompatible list lengths (2 and 3):\n generated.cue:3:33\n" 131 131 } 132 132 }, 133 133 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/additionalProperties.json
··· 226 226 } 227 227 }, 228 228 "skip": { 229 - "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:7:3\n", 230 - "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:7:3\n" 229 + "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:8:3\n", 230 + "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:8:3\n" 231 231 }, 232 232 "tests": [ 233 233 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2019-09/anchor.json
··· 12 12 } 13 13 }, 14 14 "skip": { 15 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 16 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 15 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#foo: anchors (foo) not supported (and 1 more errors)", 16 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#foo: anchors (foo) not supported (and 1 more errors)" 17 17 }, 18 18 "tests": [ 19 19 { ··· 50 50 } 51 51 }, 52 52 "skip": { 53 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 54 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 53 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/bar#foo: anchors (foo) not supported (and 1 more errors)", 54 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/bar#foo: anchors (foo) not supported (and 1 more errors)" 55 55 }, 56 56 "tests": [ 57 57 { ··· 93 93 } 94 94 }, 95 95 "skip": { 96 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 97 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 96 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/nested.json#foo: anchors (foo) not supported (and 1 more errors)", 97 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/nested.json#foo: anchors (foo) not supported (and 1 more errors)" 98 98 }, 99 99 "tests": [ 100 100 { ··· 141 141 "$ref": "child1#my_anchor" 142 142 }, 143 143 "skip": { 144 - "v2": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)", 145 - "v3": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)" 144 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/child1#my_anchor: anchors (my_anchor) not supported (and 1 more errors)", 145 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/child1#my_anchor: anchors (my_anchor) not supported (and 1 more errors)" 146 146 }, 147 147 "tests": [ 148 148 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2019-09/const.json
··· 321 321 "data": 0.0, 322 322 "valid": true, 323 323 "skip": { 324 - "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 325 - "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 324 + "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 325 + "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 326 326 } 327 327 }, 328 328 { ··· 364 364 "data": 1.0, 365 365 "valid": true, 366 366 "skip": { 367 - "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 368 - "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 367 + "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 368 + "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 369 369 } 370 370 } 371 371 ] ··· 382 382 "data": -2, 383 383 "valid": true, 384 384 "skip": { 385 - "v2": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:2:1\n instance.json:1:1\n", 386 - "v3": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:2:1\n instance.json:1:1\n" 385 + "v2": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:3:1\n instance.json:1:1\n", 386 + "v3": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:3:1\n instance.json:1:1\n" 387 387 } 388 388 }, 389 389 { ··· 430 430 "data": 9007199254740992.0, 431 431 "valid": true, 432 432 "skip": { 433 - "v2": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 434 - "v3": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 433 + "v2": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 434 + "v3": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 435 435 } 436 436 }, 437 437 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/contains.json
··· 209 209 ], 210 210 "valid": true, 211 211 "skip": { 212 - "v2": "6 errors in empty disjunction:\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:4:1\n generated.cue:4:72\n instance.json:1:1\nconflicting values bool and [\"foo\"] (mismatched types bool and list):\n generated.cue:4:8\n instance.json:1:1\nconflicting values null and [\"foo\"] (mismatched types null and list):\n generated.cue:4:1\n instance.json:1:1\nconflicting values number and [\"foo\"] (mismatched types number and list):\n generated.cue:4:15\n instance.json:1:1\nconflicting values string and [\"foo\"] (mismatched types string and list):\n generated.cue:4:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:58\n", 213 - "v3": "conflicting values [\"foo\"] and bool (mismatched types list and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values [\"foo\"] and null (mismatched types list and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values [\"foo\"] and number (mismatched types list and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values [\"foo\"] and string (mismatched types list and string):\n generated.cue:4:24\n instance.json:1:1\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:4:72\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:58\n" 212 + "v2": "6 errors in empty disjunction:\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:5:1\n generated.cue:5:72\n instance.json:1:1\nconflicting values bool and [\"foo\"] (mismatched types bool and list):\n generated.cue:5:8\n instance.json:1:1\nconflicting values null and [\"foo\"] (mismatched types null and list):\n generated.cue:5:1\n instance.json:1:1\nconflicting values number and [\"foo\"] (mismatched types number and list):\n generated.cue:5:15\n instance.json:1:1\nconflicting values string and [\"foo\"] (mismatched types string and list):\n generated.cue:5:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:58\n", 213 + "v3": "conflicting values [\"foo\"] and bool (mismatched types list and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values [\"foo\"] and null (mismatched types list and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values [\"foo\"] and number (mismatched types list and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values [\"foo\"] and string (mismatched types list and string):\n generated.cue:5:24\n instance.json:1:1\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:5:72\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:58\n" 214 214 } 215 215 }, 216 216 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2019-09/enum.json
··· 336 336 "data": 0.0, 337 337 "valid": true, 338 338 "skip": { 339 - "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 340 - "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 339 + "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 340 + "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 341 341 } 342 342 } 343 343 ] ··· 374 374 ], 375 375 "valid": true, 376 376 "skip": { 377 - "v2": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n generated.cue:2:2\n instance.json:1:2\n", 378 - "v3": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:2\n instance.json:1:2\n" 377 + "v2": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n generated.cue:3:2\n instance.json:1:2\n", 378 + "v3": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:2\n instance.json:1:2\n" 379 379 } 380 380 } 381 381 ] ··· 404 404 "data": 1.0, 405 405 "valid": true, 406 406 "skip": { 407 - "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 408 - "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 407 + "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 408 + "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 409 409 } 410 410 } 411 411 ] ··· 442 442 ], 443 443 "valid": true, 444 444 "skip": { 445 - "v2": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n generated.cue:2:2\n instance.json:1:2\n", 446 - "v3": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:2\n instance.json:1:2\n" 445 + "v2": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n generated.cue:3:2\n instance.json:1:2\n", 446 + "v3": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:2\n instance.json:1:2\n" 447 447 } 448 448 } 449 449 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/if-then-else.json
··· 230 230 } 231 231 }, 232 232 "skip": { 233 - "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:2:9\n", 234 - "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:2:9\n" 233 + "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:3:9\n", 234 + "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:3:9\n" 235 235 }, 236 236 "tests": [ 237 237 {
+9 -9
encoding/jsonschema/testdata/external/tests/draft2019-09/items.json
··· 79 79 ], 80 80 "valid": true, 81 81 "skip": { 82 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:54\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 83 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:54\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:2:33\n" 82 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:54\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 83 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:54\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:3:33\n" 84 84 } 85 85 }, 86 86 { ··· 97 97 "data": [], 98 98 "valid": true, 99 99 "skip": { 100 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:54\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 101 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:54\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:2:33\n" 100 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:54\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 101 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:54\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:3:33\n" 102 102 } 103 103 }, 104 104 { ··· 175 175 ], 176 176 "valid": true, 177 177 "skip": { 178 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:49\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 179 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:49\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:2:33\nexplicit error (_|_ literal) in source:\n generated.cue:2:37\n" 178 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:49\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 179 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:49\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:3:33\nexplicit error (_|_ literal) in source:\n generated.cue:3:37\n" 180 180 } 181 181 }, 182 182 { ··· 192 192 "data": [], 193 193 "valid": true, 194 194 "skip": { 195 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:49\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 196 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:49\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:2:33\n" 195 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:49\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 196 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:49\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:3:33\n" 197 197 } 198 198 } 199 199 ] ··· 408 408 "valid": true, 409 409 "skip": { 410 410 "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", 411 - "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:4:8\n" 411 + "v3": "incompatible list lengths (2 and 3):\n generated.cue:3:1\n0: incompatible list lengths (1 and 2):\n generated.cue:10:8\n" 412 412 } 413 413 } 414 414 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/not.json
··· 280 280 ], 281 281 "valid": true, 282 282 "skip": { 283 - "v2": "invalid value [\"foo\"] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:2:1\n generated.cue:1:1\n generated.cue:2:8\n instance.json:1:1\n" 283 + "v2": "invalid value [\"foo\"] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:3:1\n generated.cue:1:1\n generated.cue:3:8\n instance.json:1:1\n" 284 284 } 285 285 }, 286 286 { ··· 288 288 "data": [], 289 289 "valid": true, 290 290 "skip": { 291 - "v2": "invalid value [] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:2:1\n generated.cue:1:1\n generated.cue:2:8\n instance.json:1:1\n" 291 + "v2": "invalid value [] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:3:1\n generated.cue:1:1\n generated.cue:3:8\n instance.json:1:1\n" 292 292 } 293 293 } 294 294 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/anchor.json
··· 34 34 ] 35 35 }, 36 36 "skip": { 37 - "v2": "extract error: keyword \"$anchor\" not yet implemented (and 1 more errors)", 38 - "v3": "extract error: keyword \"$anchor\" not yet implemented (and 1 more errors)" 37 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#my_anchor: anchors (my_anchor) not supported (and 1 more errors)", 38 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#my_anchor: anchors (my_anchor) not supported (and 1 more errors)" 39 39 }, 40 40 "tests": [ 41 41 {
+10 -10
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/ecmascript-regex.json
··· 216 216 "data": "\u000b", 217 217 "valid": true, 218 218 "skip": { 219 - "v2": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 220 - "v3": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 219 + "v2": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 220 + "v3": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 221 221 } 222 222 }, 223 223 { ··· 230 230 "data": " ", 231 231 "valid": true, 232 232 "skip": { 233 - "v2": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 234 - "v3": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 233 + "v2": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 234 + "v3": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 235 235 } 236 236 }, 237 237 { ··· 239 239 "data": "\ufeff", 240 240 "valid": true, 241 241 "skip": { 242 - "v2": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 243 - "v3": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 242 + "v2": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 243 + "v3": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 244 244 } 245 245 }, 246 246 { ··· 253 253 "data": "\u2029", 254 254 "valid": true, 255 255 "skip": { 256 - "v2": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 257 - "v3": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 256 + "v2": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 257 + "v3": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 258 258 } 259 259 }, 260 260 { ··· 262 262 "data": " ", 263 263 "valid": true, 264 264 "skip": { 265 - "v2": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 266 - "v3": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 265 + "v2": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 266 + "v3": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 267 267 } 268 268 }, 269 269 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/float-overflow.json
··· 12 12 "data": 1E+308, 13 13 "valid": true, 14 14 "skip": { 15 - "v2": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:4:1\n instance.json:1:1\n", 16 - "v3": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:4:1\n instance.json:1:1\n" 15 + "v2": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:5:1\n instance.json:1:1\n", 16 + "v3": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:5:1\n instance.json:1:1\n" 17 17 } 18 18 } 19 19 ]
+6 -6
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/date-time.json
··· 61 61 "data": "1998-12-31T23:59:60Z", 62 62 "valid": true, 63 63 "skip": { 64 - "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", 65 - "v3": "conflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" 64 + "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", 65 + "v3": "conflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" 66 66 } 67 67 }, 68 68 { ··· 70 70 "data": "1998-12-31T15:59:60.123-08:00", 71 71 "valid": true, 72 72 "skip": { 73 - "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 74 - "v3": "conflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 73 + "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 74 + "v3": "conflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 75 75 } 76 76 }, 77 77 { ··· 118 118 "data": "1963-06-19t08:30:06.283185z", 119 119 "valid": true, 120 120 "skip": { 121 - "v2": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", 122 - "v3": "conflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" 121 + "v2": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", 122 + "v3": "conflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" 123 123 } 124 124 }, 125 125 {
+3 -19
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/id.json
··· 33 33 } 34 34 ] 35 35 }, 36 - "skip": { 37 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2019-09/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 38 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2019-09/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 39 - }, 40 36 "tests": [ 41 37 { 42 38 "description": "exact match to enum, and type matches", ··· 44 40 "$id": "https://localhost:1234/draft2019-09/id/my_identifier.json", 45 41 "type": "null" 46 42 }, 47 - "valid": true, 48 - "skip": { 49 - "v2": "could not compile schema", 50 - "v3": "could not compile schema" 51 - } 43 + "valid": true 52 44 }, 53 45 { 54 46 "description": "match $ref to $id", 55 47 "data": "a string to match #/$defs/id_in_enum", 56 - "valid": true, 57 - "skip": { 58 - "v2": "could not compile schema", 59 - "v3": "could not compile schema" 60 - } 48 + "valid": true 61 49 }, 62 50 { 63 51 "description": "no match on enum or $ref to $id", 64 52 "data": 1, 65 - "valid": false, 66 - "skip": { 67 - "v2": "could not compile schema", 68 - "v3": "could not compile schema" 69 - } 53 + "valid": false 70 54 } 71 55 ] 72 56 }
+6 -42
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/refOfUnknownKeyword.json
··· 12 12 } 13 13 } 14 14 }, 15 - "skip": { 16 - "v2": "extract error: cannot compile resulting schema: bar: reference \"_X0\" not found:\n generated.cue:3:8\n", 17 - "v3": "extract error: cannot compile resulting schema: bar: reference \"_X0\" not found:\n generated.cue:3:8\n" 18 - }, 19 15 "tests": [ 20 16 { 21 17 "description": "match", 22 18 "data": { 23 19 "bar": 3 24 20 }, 25 - "valid": true, 26 - "skip": { 27 - "v2": "could not compile schema", 28 - "v3": "could not compile schema" 29 - } 21 + "valid": true 30 22 }, 31 23 { 32 24 "description": "mismatch", 33 25 "data": { 34 26 "bar": true 35 27 }, 36 - "valid": false, 37 - "skip": { 38 - "v2": "could not compile schema", 39 - "v3": "could not compile schema" 40 - } 28 + "valid": false 41 29 } 42 30 ] 43 31 }, ··· 56 44 } 57 45 } 58 46 }, 59 - "skip": { 60 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 61 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 62 - }, 63 47 "tests": [ 64 48 { 65 49 "description": "match", 66 50 "data": { 67 51 "bar": 3 68 52 }, 69 - "valid": true, 70 - "skip": { 71 - "v2": "could not compile schema", 72 - "v3": "could not compile schema" 73 - } 53 + "valid": true 74 54 }, 75 55 { 76 56 "description": "mismatch", 77 57 "data": { 78 58 "bar": true 79 59 }, 80 - "valid": false, 81 - "skip": { 82 - "v2": "could not compile schema", 83 - "v3": "could not compile schema" 84 - } 60 + "valid": false 85 61 } 86 62 ] 87 63 }, ··· 96 72 } 97 73 ], 98 74 "$ref": "#/examples/0" 99 - }, 100 - "skip": { 101 - "v2": "extract error: reference to non-existing value \"examples\"", 102 - "v3": "extract error: reference to non-existing value \"examples\"" 103 75 }, 104 76 "tests": [ 105 77 { 106 78 "description": "match", 107 79 "data": "a string", 108 - "valid": true, 109 - "skip": { 110 - "v2": "could not compile schema", 111 - "v3": "could not compile schema" 112 - } 80 + "valid": true 113 81 }, 114 82 { 115 83 "description": "mismatch", 116 84 "data": 42, 117 - "valid": false, 118 - "skip": { 119 - "v2": "could not compile schema", 120 - "v3": "could not compile schema" 121 - } 85 + "valid": false 122 86 } 123 87 ] 124 88 }
+3 -19
encoding/jsonschema/testdata/external/tests/draft2019-09/optional/unknownKeyword.json
··· 42 42 } 43 43 ] 44 44 }, 45 - "skip": { 46 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2019-09/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 47 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2019-09/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 48 - }, 49 45 "tests": [ 50 46 { 51 47 "description": "type matches second anyOf, which has a real schema in it", 52 48 "data": "a string", 53 - "valid": true, 54 - "skip": { 55 - "v2": "could not compile schema", 56 - "v3": "could not compile schema" 57 - } 49 + "valid": true 58 50 }, 59 51 { 60 52 "description": "type matches non-schema in first anyOf", 61 53 "data": null, 62 - "valid": false, 63 - "skip": { 64 - "v2": "could not compile schema", 65 - "v3": "could not compile schema" 66 - } 54 + "valid": false 67 55 }, 68 56 { 69 57 "description": "type matches non-schema in third anyOf", 70 58 "data": 1, 71 - "valid": false, 72 - "skip": { 73 - "v2": "could not compile schema", 74 - "v3": "could not compile schema" 75 - } 59 + "valid": false 76 60 } 77 61 ] 78 62 }
+3 -3
encoding/jsonschema/testdata/external/tests/draft2019-09/propertyNames.json
··· 8 8 } 9 9 }, 10 10 "skip": { 11 - "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:5:3\n", 12 - "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:5:3\n" 11 + "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:6:3\n", 12 + "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:6:3\n" 13 13 }, 14 14 "tests": [ 15 15 { ··· 158 158 "data": {}, 159 159 "valid": true, 160 160 "skip": { 161 - "v3": "conflicting values [...] and {} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:3\n" 161 + "v3": "conflicting values [...] and {} (mismatched types list and struct):\n generated.cue:3:33\n instance.json:1:1\nconflicting values bool and {} (mismatched types bool and struct):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and {} (mismatched types null and struct):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and {} (mismatched types number and struct):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and {} (mismatched types string and struct):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:3\n" 162 162 } 163 163 } 164 164 ]
+16 -16
encoding/jsonschema/testdata/external/tests/draft2019-09/recursiveRef.json
··· 97 97 ] 98 98 }, 99 99 "skip": { 100 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)", 101 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)" 100 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 101 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 102 102 }, 103 103 "tests": [ 104 104 { ··· 193 193 ] 194 194 }, 195 195 "skip": { 196 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)", 197 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)" 196 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)", 197 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)" 198 198 }, 199 199 "tests": [ 200 200 { ··· 289 289 ] 290 290 }, 291 291 "skip": { 292 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)", 293 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)" 292 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)", 293 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)" 294 294 }, 295 295 "tests": [ 296 296 { ··· 384 384 ] 385 385 }, 386 386 "skip": { 387 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)", 388 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)" 387 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 388 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 389 389 }, 390 390 "tests": [ 391 391 { ··· 478 478 ] 479 479 }, 480 480 "skip": { 481 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)", 482 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)" 481 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 482 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 483 483 }, 484 484 "tests": [ 485 485 { ··· 551 551 ] 552 552 }, 553 553 "skip": { 554 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)", 555 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 1 more errors)" 554 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 555 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 556 556 }, 557 557 "tests": [ 558 558 { ··· 632 632 } 633 633 }, 634 634 "skip": { 635 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 636 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 635 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)", 636 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)" 637 637 }, 638 638 "tests": [ 639 639 { ··· 698 698 } 699 699 }, 700 700 "skip": { 701 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 702 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 701 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)", 702 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)" 703 703 }, 704 704 "tests": [ 705 705 {
+40 -186
encoding/jsonschema/testdata/external/tests/draft2019-09/ref.json
··· 64 64 } 65 65 } 66 66 }, 67 - "skip": { 68 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 69 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 70 - }, 71 67 "tests": [ 72 68 { 73 69 "description": "match", 74 70 "data": { 75 71 "bar": 3 76 72 }, 77 - "valid": true, 78 - "skip": { 79 - "v2": "could not compile schema", 80 - "v3": "could not compile schema" 81 - } 73 + "valid": true 82 74 }, 83 75 { 84 76 "description": "mismatch", 85 77 "data": { 86 78 "bar": true 87 79 }, 88 - "valid": false, 89 - "skip": { 90 - "v2": "could not compile schema", 91 - "v3": "could not compile schema" 92 - } 80 + "valid": false 93 81 } 94 82 ] 95 83 }, ··· 106 94 } 107 95 ] 108 96 }, 109 - "skip": { 110 - "v2": "extract error: referring to field \"items\" not yet supported", 111 - "v3": "extract error: referring to field \"items\" not yet supported" 112 - }, 113 97 "tests": [ 114 98 { 115 99 "description": "match array", ··· 117 101 1, 118 102 2 119 103 ], 120 - "valid": true, 121 - "skip": { 122 - "v2": "could not compile schema", 123 - "v3": "could not compile schema" 124 - } 104 + "valid": true 125 105 }, 126 106 { 127 107 "description": "mismatch array", ··· 129 109 1, 130 110 "foo" 131 111 ], 132 - "valid": false, 133 - "skip": { 134 - "v2": "could not compile schema", 135 - "v3": "could not compile schema" 136 - } 112 + "valid": false 137 113 } 138 114 ] 139 115 }, ··· 170 146 "data": { 171 147 "slash": "aoeu" 172 148 }, 173 - "valid": false, 174 - "skip": { 175 - "v3": "unexpected success" 176 - } 149 + "valid": false 177 150 }, 178 151 { 179 152 "description": "tilde invalid", 180 153 "data": { 181 154 "tilde": "aoeu" 182 155 }, 183 - "valid": false, 184 - "skip": { 185 - "v3": "unexpected success" 186 - } 156 + "valid": false 187 157 }, 188 158 { 189 159 "description": "percent invalid", 190 160 "data": { 191 161 "percent": "aoeu" 192 162 }, 193 - "valid": false, 194 - "skip": { 195 - "v3": "unexpected success" 196 - } 163 + "valid": false 197 164 }, 198 165 { 199 166 "description": "slash valid", 200 167 "data": { 201 168 "slash": 123 202 169 }, 203 - "valid": true, 204 - "skip": { 205 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {slash:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {slash:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {slash:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {slash:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {slash:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nslash: undefined field: \"slash~1field\":\n generated.cue:4:14\n" 206 - } 170 + "valid": true 207 171 }, 208 172 { 209 173 "description": "tilde valid", 210 174 "data": { 211 175 "tilde": 123 212 176 }, 213 - "valid": true, 214 - "skip": { 215 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {tilde:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {tilde:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {tilde:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {tilde:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {tilde:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\ntilde: undefined field: \"tilde~0field\":\n generated.cue:3:14\n" 216 - } 177 + "valid": true 217 178 }, 218 179 { 219 180 "description": "percent valid", 220 181 "data": { 221 182 "percent": 123 222 183 }, 223 - "valid": true, 224 - "skip": { 225 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {percent:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {percent:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {percent:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {percent:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {percent:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\npercent: undefined field: \"percent%25field\":\n generated.cue:5:14\n" 226 - } 184 + "valid": true 227 185 } 228 186 ] 229 187 }, ··· 422 380 } 423 381 }, 424 382 "skip": { 425 - "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:8\n", 426 - "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:8\n" 383 + "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:5:8\n", 384 + "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:5:8\n" 427 385 }, 428 386 "tests": [ 429 387 { ··· 478 436 } 479 437 } 480 438 }, 481 - "skip": { 482 - "v2": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/draft2019-09/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:9:14\n", 483 - "v3": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/draft2019-09/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:9:14\n" 484 - }, 485 439 "tests": [ 486 440 { 487 441 "description": "valid tree", ··· 518 472 } 519 473 ] 520 474 }, 521 - "valid": true, 522 - "skip": { 523 - "v2": "could not compile schema", 524 - "v3": "could not compile schema" 525 - } 475 + "valid": true 526 476 }, 527 477 { 528 478 "description": "invalid tree", ··· 559 509 } 560 510 ] 561 511 }, 562 - "valid": false, 563 - "skip": { 564 - "v2": "could not compile schema", 565 - "v3": "could not compile schema" 566 - } 512 + "valid": false 567 513 } 568 514 ] 569 515 }, ··· 588 534 "data": { 589 535 "foo\"bar": 1 590 536 }, 591 - "valid": true, 592 - "skip": { 593 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {\"foo\\\"bar\":1} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {\"foo\\\"bar\":1} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {\"foo\\\"bar\":1} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {\"foo\\\"bar\":1} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {\"foo\\\"bar\":1} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\n\"foo\\\"bar\": undefined field: \"foo%22bar\":\n generated.cue:3:17\n" 594 - } 537 + "valid": true 595 538 }, 596 539 { 597 540 "description": "object with strings is invalid", 598 541 "data": { 599 542 "foo\"bar": "1" 600 543 }, 601 - "valid": false, 602 - "skip": { 603 - "v3": "unexpected success" 604 - } 544 + "valid": false 605 545 } 606 546 ] 607 547 }, ··· 622 562 "$ref": "#/$defs/A" 623 563 }, 624 564 "skip": { 625 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 626 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 565 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 566 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 627 567 }, 628 568 "tests": [ 629 569 { ··· 698 638 }, 699 639 "$ref": "schema-relative-uri-defs2.json" 700 640 }, 701 - "skip": { 702 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 703 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 704 - }, 705 641 "tests": [ 706 642 { 707 643 "description": "invalid on inner field", ··· 711 647 }, 712 648 "bar": "a" 713 649 }, 714 - "valid": false, 715 - "skip": { 716 - "v2": "could not compile schema", 717 - "v3": "could not compile schema" 718 - } 650 + "valid": false 719 651 }, 720 652 { 721 653 "description": "invalid on outer field", ··· 725 657 }, 726 658 "bar": 1 727 659 }, 728 - "valid": false, 729 - "skip": { 730 - "v2": "could not compile schema", 731 - "v3": "could not compile schema" 732 - } 660 + "valid": false 733 661 }, 734 662 { 735 663 "description": "valid on both fields", ··· 739 667 }, 740 668 "bar": "a" 741 669 }, 742 - "valid": true, 743 - "skip": { 744 - "v2": "could not compile schema", 745 - "v3": "could not compile schema" 746 - } 670 + "valid": true 747 671 } 748 672 ] 749 673 }, ··· 769 693 }, 770 694 "$ref": "schema-refs-absolute-uris-defs2.json" 771 695 }, 772 - "skip": { 773 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 774 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 775 - }, 776 696 "tests": [ 777 697 { 778 698 "description": "invalid on inner field", ··· 782 702 }, 783 703 "bar": "a" 784 704 }, 785 - "valid": false, 786 - "skip": { 787 - "v2": "could not compile schema", 788 - "v3": "could not compile schema" 789 - } 705 + "valid": false 790 706 }, 791 707 { 792 708 "description": "invalid on outer field", ··· 796 712 }, 797 713 "bar": 1 798 714 }, 799 - "valid": false, 800 - "skip": { 801 - "v2": "could not compile schema", 802 - "v3": "could not compile schema" 803 - } 715 + "valid": false 804 716 }, 805 717 { 806 718 "description": "valid on both fields", ··· 810 722 }, 811 723 "bar": "a" 812 724 }, 813 - "valid": true, 814 - "skip": { 815 - "v2": "could not compile schema", 816 - "v3": "could not compile schema" 817 - } 725 + "valid": true 818 726 } 819 727 ] 820 728 }, ··· 842 750 } 843 751 ] 844 752 }, 845 - "skip": { 846 - "v2": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n", 847 - "v3": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n" 848 - }, 849 753 "tests": [ 850 754 { 851 755 "description": "number is valid", 852 756 "data": 1, 853 - "valid": true, 854 - "skip": { 855 - "v2": "could not compile schema", 856 - "v3": "could not compile schema" 857 - } 757 + "valid": true 858 758 }, 859 759 { 860 760 "description": "non-number is invalid", 861 761 "data": "a", 862 - "valid": false, 863 - "skip": { 864 - "v2": "could not compile schema", 865 - "v3": "could not compile schema" 866 - } 762 + "valid": false 867 763 } 868 764 ] 869 765 }, ··· 887 783 } 888 784 } 889 785 }, 890 - "skip": { 891 - "v2": "extract error: cannot compile resulting schema: package \"example.com/draft2019-09/ref-and-id1/int.json:int\" imported but not defined in :\n generated.cue:1:8\n", 892 - "v3": "extract error: cannot compile resulting schema: package \"example.com/draft2019-09/ref-and-id1/int.json:int\" imported but not defined in :\n generated.cue:1:8\n" 893 - }, 894 786 "tests": [ 895 787 { 896 788 "description": "data is valid against first definition", 897 789 "data": 5, 898 - "valid": true, 899 - "skip": { 900 - "v2": "could not compile schema", 901 - "v3": "could not compile schema" 902 - } 790 + "valid": true 903 791 }, 904 792 { 905 793 "description": "data is invalid against first definition", 906 794 "data": 50, 907 - "valid": false, 908 - "skip": { 909 - "v2": "could not compile schema", 910 - "v3": "could not compile schema" 911 - } 795 + "valid": false 912 796 } 913 797 ] 914 798 }, ··· 934 818 } 935 819 }, 936 820 "skip": { 937 - "v2": "extract error: anchors (bigint) not supported (and 2 more errors)", 938 - "v3": "extract error: anchors (bigint) not supported (and 2 more errors)" 821 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://example.com/draft2019-09/ref-and-id2/base.json#bigint: anchors (bigint) not supported (and 1 more errors)", 822 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://example.com/draft2019-09/ref-and-id2/base.json#bigint: anchors (bigint) not supported (and 1 more errors)" 939 823 }, 940 824 "tests": [ 941 825 { ··· 1175 1059 } 1176 1060 }, 1177 1061 "skip": { 1178 - "v2": "extract error: anchors (something) not supported (and 1 more errors)", 1179 - "v3": "extract error: anchors (something) not supported (and 1 more errors)" 1062 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 1 more errors)", 1063 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 1 more errors)" 1180 1064 }, 1181 1065 "tests": [ 1182 1066 { ··· 1224 1108 { 1225 1109 "description": "a string is valid", 1226 1110 "data": "bar", 1227 - "valid": true, 1228 - "skip": { 1229 - "v2": "conflicting values \"bar\" and {_schema:{#foo:string},#foo:string} (mismatched types string and struct):\n generated.cue:2:1\n instance.json:1:1\n" 1230 - } 1111 + "valid": true 1231 1112 }, 1232 1113 { 1233 1114 "description": "a non-string is invalid", 1234 1115 "data": 12, 1235 - "valid": false, 1236 - "skip": { 1237 - "v3": "unexpected success" 1238 - } 1116 + "valid": false 1239 1117 } 1240 1118 ] 1241 1119 }, ··· 1361 1239 }, 1362 1240 "$ref": "/absref/foobar.json" 1363 1241 }, 1364 - "skip": { 1365 - "v2": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n", 1366 - "v3": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n" 1367 - }, 1368 1242 "tests": [ 1369 1243 { 1370 1244 "description": "a string is valid", 1371 1245 "data": "foo", 1372 - "valid": true, 1373 - "skip": { 1374 - "v2": "could not compile schema", 1375 - "v3": "could not compile schema" 1376 - } 1246 + "valid": true 1377 1247 }, 1378 1248 { 1379 1249 "description": "an integer is invalid", 1380 1250 "data": 12, 1381 - "valid": false, 1382 - "skip": { 1383 - "v2": "could not compile schema", 1384 - "v3": "could not compile schema" 1385 - } 1251 + "valid": false 1386 1252 } 1387 1253 ] 1388 1254 }, ··· 1455 1321 } 1456 1322 ] 1457 1323 }, 1458 - "skip": { 1459 - "v2": "extract error: cannot refer to $defs section: must refer to one of its elements", 1460 - "v3": "extract error: cannot refer to $defs section: must refer to one of its elements" 1461 - }, 1462 1324 "tests": [ 1463 1325 { 1464 1326 "description": "number is valid", 1465 1327 "data": 1, 1466 - "valid": true, 1467 - "skip": { 1468 - "v2": "could not compile schema", 1469 - "v3": "could not compile schema" 1470 - } 1328 + "valid": true 1471 1329 }, 1472 1330 { 1473 1331 "description": "non-number is invalid", 1474 1332 "data": "a", 1475 - "valid": false, 1476 - "skip": { 1477 - "v2": "could not compile schema", 1478 - "v3": "could not compile schema" 1479 - } 1333 + "valid": false 1480 1334 } 1481 1335 ] 1482 1336 }, ··· 1506 1360 } 1507 1361 }, 1508 1362 "skip": { 1509 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)", 1510 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 2 more errors)" 1363 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)", 1364 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 5 more errors)" 1511 1365 }, 1512 1366 "tests": [ 1513 1367 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/refRemote.json
··· 68 68 "$ref": "http://localhost:1234/draft2019-09/locationIndependentIdentifier.json#foo" 69 69 }, 70 70 "skip": { 71 - "v2": "extract error: anchors (foo) not supported", 72 - "v3": "extract error: anchors (foo) not supported" 71 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/locationIndependentIdentifier.json#foo: anchors (foo) not supported", 72 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2019-09/locationIndependentIdentifier.json#foo: anchors (foo) not supported" 73 73 }, 74 74 "tests": [ 75 75 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/type.json
··· 16 16 "data": 1.0, 17 17 "valid": true, 18 18 "skip": { 19 - "v2": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 20 - "v3": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 19 + "v2": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 20 + "v3": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 21 21 } 22 22 }, 23 23 {
+6 -6
encoding/jsonschema/testdata/external/tests/draft2019-09/unevaluatedItems.json
··· 861 861 } 862 862 }, 863 863 "skip": { 864 - "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented", 865 - "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented" 864 + "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)", 865 + "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)" 866 866 }, 867 867 "tests": [ 868 868 { ··· 915 915 } 916 916 }, 917 917 "skip": { 918 - "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented", 919 - "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented" 918 + "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)", 919 + "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)" 920 920 }, 921 921 "tests": [ 922 922 { ··· 979 979 } 980 980 }, 981 981 "skip": { 982 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 983 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 982 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)", 983 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)" 984 984 }, 985 985 "tests": [ 986 986 {
+10 -10
encoding/jsonschema/testdata/external/tests/draft2019-09/unevaluatedProperties.json
··· 1034 1034 } 1035 1035 }, 1036 1036 "skip": { 1037 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1038 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1037 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1038 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1039 1039 }, 1040 1040 "tests": [ 1041 1041 { ··· 1088 1088 } 1089 1089 }, 1090 1090 "skip": { 1091 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1092 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1091 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1092 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1093 1093 }, 1094 1094 "tests": [ 1095 1095 { ··· 1151 1151 } 1152 1152 }, 1153 1153 "skip": { 1154 - "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)", 1155 - "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 3 more errors)" 1154 + "v2": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)", 1155 + "v3": "extract error: keyword \"$recursiveAnchor\" not yet implemented (and 7 more errors)" 1156 1156 }, 1157 1157 "tests": [ 1158 1158 { ··· 1886 1886 "unevaluatedProperties": false 1887 1887 }, 1888 1888 "skip": { 1889 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1890 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1889 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1890 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1891 1891 }, 1892 1892 "tests": [ 1893 1893 { ··· 2060 2060 "unevaluatedProperties": false 2061 2061 }, 2062 2062 "skip": { 2063 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 2064 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 2063 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 3 more errors)", 2064 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 3 more errors)" 2065 2065 }, 2066 2066 "tests": [ 2067 2067 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2019-09/vocabulary.json
··· 12 12 } 13 13 }, 14 14 "skip": { 15 - "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2019-09/metaschema-no-validation.json\": $schema URI not recognized", 16 - "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2019-09/metaschema-no-validation.json\": $schema URI not recognized" 15 + "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2019-09/metaschema-no-validation.json\": $schema URI not recognized (and 1 more errors)", 16 + "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2019-09/metaschema-no-validation.json\": $schema URI not recognized (and 1 more errors)" 17 17 }, 18 18 "tests": [ 19 19 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/additionalProperties.json
··· 226 226 } 227 227 }, 228 228 "skip": { 229 - "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:7:3\n", 230 - "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:7:3\n" 229 + "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:8:3\n", 230 + "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:8:3\n" 231 231 }, 232 232 "tests": [ 233 233 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2020-12/anchor.json
··· 12 12 } 13 13 }, 14 14 "skip": { 15 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 16 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 15 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#foo: anchors (foo) not supported (and 1 more errors)", 16 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#foo: anchors (foo) not supported (and 1 more errors)" 17 17 }, 18 18 "tests": [ 19 19 { ··· 50 50 } 51 51 }, 52 52 "skip": { 53 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 54 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 53 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/bar#foo: anchors (foo) not supported (and 1 more errors)", 54 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/bar#foo: anchors (foo) not supported (and 1 more errors)" 55 55 }, 56 56 "tests": [ 57 57 { ··· 93 93 } 94 94 }, 95 95 "skip": { 96 - "v2": "extract error: anchors (foo) not supported (and 1 more errors)", 97 - "v3": "extract error: anchors (foo) not supported (and 1 more errors)" 96 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/nested.json#foo: anchors (foo) not supported (and 1 more errors)", 97 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/nested.json#foo: anchors (foo) not supported (and 1 more errors)" 98 98 }, 99 99 "tests": [ 100 100 { ··· 141 141 "$ref": "child1#my_anchor" 142 142 }, 143 143 "skip": { 144 - "v2": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)", 145 - "v3": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)" 144 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/child1#my_anchor: anchors (my_anchor) not supported (and 1 more errors)", 145 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/child1#my_anchor: anchors (my_anchor) not supported (and 1 more errors)" 146 146 }, 147 147 "tests": [ 148 148 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2020-12/const.json
··· 321 321 "data": 0.0, 322 322 "valid": true, 323 323 "skip": { 324 - "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 325 - "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 324 + "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 325 + "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 326 326 } 327 327 }, 328 328 { ··· 364 364 "data": 1.0, 365 365 "valid": true, 366 366 "skip": { 367 - "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 368 - "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 367 + "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 368 + "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 369 369 } 370 370 } 371 371 ] ··· 382 382 "data": -2, 383 383 "valid": true, 384 384 "skip": { 385 - "v2": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:2:1\n instance.json:1:1\n", 386 - "v3": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:2:1\n instance.json:1:1\n" 385 + "v2": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:3:1\n instance.json:1:1\n", 386 + "v3": "conflicting values -2 and -2.0 (mismatched types int and float):\n generated.cue:3:1\n instance.json:1:1\n" 387 387 } 388 388 }, 389 389 { ··· 430 430 "data": 9007199254740992.0, 431 431 "valid": true, 432 432 "skip": { 433 - "v2": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 434 - "v3": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 433 + "v2": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 434 + "v3": "conflicting values 9007199254740992.0 and 9007199254740992 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 435 435 } 436 436 }, 437 437 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/contains.json
··· 209 209 ], 210 210 "valid": true, 211 211 "skip": { 212 - "v2": "6 errors in empty disjunction:\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:4:1\n generated.cue:4:72\n instance.json:1:1\nconflicting values bool and [\"foo\"] (mismatched types bool and list):\n generated.cue:4:8\n instance.json:1:1\nconflicting values null and [\"foo\"] (mismatched types null and list):\n generated.cue:4:1\n instance.json:1:1\nconflicting values number and [\"foo\"] (mismatched types number and list):\n generated.cue:4:15\n instance.json:1:1\nconflicting values string and [\"foo\"] (mismatched types string and list):\n generated.cue:4:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:58\n", 213 - "v3": "conflicting values [\"foo\"] and bool (mismatched types list and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values [\"foo\"] and null (mismatched types list and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values [\"foo\"] and number (mismatched types list and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values [\"foo\"] and string (mismatched types list and string):\n generated.cue:4:24\n instance.json:1:1\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:4:72\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:58\n" 212 + "v2": "6 errors in empty disjunction:\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:5:1\n generated.cue:5:72\n instance.json:1:1\nconflicting values bool and [\"foo\"] (mismatched types bool and list):\n generated.cue:5:8\n instance.json:1:1\nconflicting values null and [\"foo\"] (mismatched types null and list):\n generated.cue:5:1\n instance.json:1:1\nconflicting values number and [\"foo\"] (mismatched types number and list):\n generated.cue:5:15\n instance.json:1:1\nconflicting values string and [\"foo\"] (mismatched types string and list):\n generated.cue:5:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:58\n", 213 + "v3": "conflicting values [\"foo\"] and bool (mismatched types list and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values [\"foo\"] and null (mismatched types list and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values [\"foo\"] and number (mismatched types list and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values [\"foo\"] and string (mismatched types list and string):\n generated.cue:5:24\n instance.json:1:1\nconflicting values [\"foo\"] and {...} (mismatched types list and struct):\n generated.cue:5:72\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:58\n" 214 214 } 215 215 }, 216 216 {
+36 -36
encoding/jsonschema/testdata/external/tests/draft2020-12/dynamicRef.json
··· 16 16 } 17 17 }, 18 18 "skip": { 19 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 1 more errors)", 20 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 1 more errors)" 19 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)", 20 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)" 21 21 }, 22 22 "tests": [ 23 23 { ··· 110 110 } 111 111 }, 112 112 "skip": { 113 - "v2": "extract error: anchors (items) not supported (and 1 more errors)", 114 - "v3": "extract error: anchors (items) not supported (and 1 more errors)" 113 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://test.json-schema.org/ref-dynamicAnchor-same-schema/root#items: anchors (items) not supported (and 3 more errors)", 114 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://test.json-schema.org/ref-dynamicAnchor-same-schema/root#items: anchors (items) not supported (and 3 more errors)" 115 115 }, 116 116 "tests": [ 117 117 { ··· 167 167 } 168 168 }, 169 169 "skip": { 170 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 171 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 170 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)", 171 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)" 172 172 }, 173 173 "tests": [ 174 174 { ··· 225 225 } 226 226 }, 227 227 "skip": { 228 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 229 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 228 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)", 229 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)" 230 230 }, 231 231 "tests": [ 232 232 { ··· 286 286 } 287 287 }, 288 288 "skip": { 289 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 290 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 289 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)", 290 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)" 291 291 }, 292 292 "tests": [ 293 293 { ··· 343 343 } 344 344 }, 345 345 "skip": { 346 - "v2": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)", 347 - "v3": "extract error: keyword \"$anchor\" not yet implemented (and 2 more errors)" 346 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)", 347 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)" 348 348 }, 349 349 "tests": [ 350 350 { ··· 388 388 } 389 389 }, 390 390 "skip": { 391 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 392 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 391 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 392 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 393 393 }, 394 394 "tests": [ 395 395 { ··· 434 434 } 435 435 }, 436 436 "skip": { 437 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 438 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 437 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)", 438 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)" 439 439 }, 440 440 "tests": [ 441 441 { ··· 488 488 } 489 489 }, 490 490 "skip": { 491 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 492 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 491 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)", 492 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 5 more errors)" 493 493 }, 494 494 "tests": [ 495 495 { ··· 562 562 } 563 563 }, 564 564 "skip": { 565 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)", 566 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 2 more errors)" 565 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 566 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 567 567 }, 568 568 "tests": [ 569 569 { ··· 645 645 } 646 646 }, 647 647 "skip": { 648 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)", 649 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)" 648 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 7 more errors)", 649 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 7 more errors)" 650 650 }, 651 651 "tests": [ 652 652 { ··· 748 748 } 749 749 }, 750 750 "skip": { 751 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)", 752 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)" 751 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 7 more errors)", 752 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 7 more errors)" 753 753 }, 754 754 "tests": [ 755 755 { ··· 791 791 "unevaluatedProperties": false 792 792 }, 793 793 "skip": { 794 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)", 795 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)" 794 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 795 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 796 796 }, 797 797 "tests": [ 798 798 { ··· 847 847 } 848 848 }, 849 849 "skip": { 850 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented", 851 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented" 850 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)", 851 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)" 852 852 }, 853 853 "tests": [ 854 854 { ··· 920 920 ] 921 921 }, 922 922 "skip": { 923 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented", 924 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented" 923 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)", 924 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)" 925 925 }, 926 926 "tests": [ 927 927 { ··· 993 993 ] 994 994 }, 995 995 "skip": { 996 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented", 997 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented" 996 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)", 997 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 1 more errors)" 998 998 }, 999 999 "tests": [ 1000 1000 { ··· 1088 1088 } 1089 1089 }, 1090 1090 "skip": { 1091 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 1 more errors)", 1092 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 1 more errors)" 1091 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)", 1092 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 3 more errors)" 1093 1093 }, 1094 1094 "tests": [ 1095 1095 { ··· 1159 1159 } 1160 1160 }, 1161 1161 "skip": { 1162 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 2 more errors)", 1163 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 2 more errors)" 1162 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 5 more errors)", 1163 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 5 more errors)" 1164 1164 }, 1165 1165 "tests": [ 1166 1166 {
+8 -8
encoding/jsonschema/testdata/external/tests/draft2020-12/enum.json
··· 336 336 "data": 0.0, 337 337 "valid": true, 338 338 "skip": { 339 - "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 340 - "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 339 + "v2": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 340 + "v3": "conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 341 341 } 342 342 } 343 343 ] ··· 374 374 ], 375 375 "valid": true, 376 376 "skip": { 377 - "v2": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:1\n generated.cue:2:2\n instance.json:1:2\n", 378 - "v3": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:2:2\n instance.json:1:2\n" 377 + "v2": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:1\n generated.cue:3:2\n instance.json:1:2\n", 378 + "v3": "0: conflicting values 0.0 and 0 (mismatched types float and int):\n generated.cue:3:2\n instance.json:1:2\n" 379 379 } 380 380 } 381 381 ] ··· 404 404 "data": 1.0, 405 405 "valid": true, 406 406 "skip": { 407 - "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 408 - "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 407 + "v2": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 408 + "v3": "conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 409 409 } 410 410 } 411 411 ] ··· 442 442 ], 443 443 "valid": true, 444 444 "skip": { 445 - "v2": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:1\n generated.cue:2:2\n instance.json:1:2\n", 446 - "v3": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:2:2\n instance.json:1:2\n" 445 + "v2": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:1\n generated.cue:3:2\n instance.json:1:2\n", 446 + "v3": "0: conflicting values 1.0 and 1 (mismatched types float and int):\n generated.cue:3:2\n instance.json:1:2\n" 447 447 } 448 448 } 449 449 ]
+8 -8
encoding/jsonschema/testdata/external/tests/draft2020-12/format.json
··· 129 129 "data": "^(abc]", 130 130 "valid": true, 131 131 "skip": { 132 - "v2": "6 errors in empty disjunction:\nconflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n", 133 - "v3": "conflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:4:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:4:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n" 132 + "v2": "6 errors in empty disjunction:\nconflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n", 133 + "v3": "conflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:5:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:5:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n" 134 134 } 135 135 } 136 136 ] ··· 353 353 "data": "06/19/1963", 354 354 "valid": true, 355 355 "skip": { 356 - "v2": "6 errors in empty disjunction:\nconflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n generated.cue:4:24\n generated.cue:1:1\n generated.cue:4:36\n instance.json:1:1\n", 357 - "v3": "conflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:4:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:4:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n generated.cue:4:24\n generated.cue:1:1\n generated.cue:4:36\n instance.json:1:1\n" 356 + "v2": "6 errors in empty disjunction:\nconflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n generated.cue:5:24\n generated.cue:1:1\n generated.cue:5:36\n instance.json:1:1\n", 357 + "v3": "conflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:5:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:5:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n generated.cue:5:24\n generated.cue:1:1\n generated.cue:5:36\n instance.json:1:1\n" 358 358 } 359 359 } 360 360 ] ··· 401 401 "data": "1990-02-31T15:59:60.123-08:00", 402 402 "valid": true, 403 403 "skip": { 404 - "v2": "6 errors in empty disjunction:\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 405 - "v3": "conflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 404 + "v2": "6 errors in empty disjunction:\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 405 + "v3": "conflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 406 406 } 407 407 } 408 408 ] ··· 669 669 "data": "//foo.bar/?baz=qux#quux", 670 670 "valid": true, 671 671 "skip": { 672 - "v2": "6 errors in empty disjunction:\nconflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n", 673 - "v3": "conflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:4:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:4:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n" 672 + "v2": "6 errors in empty disjunction:\nconflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n", 673 + "v3": "conflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:5:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:5:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n" 674 674 } 675 675 } 676 676 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/if-then-else.json
··· 230 230 } 231 231 }, 232 232 "skip": { 233 - "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:2:9\n", 234 - "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:2:9\n" 233 + "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:3:9\n", 234 + "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:3:9\n" 235 235 }, 236 236 "tests": [ 237 237 {
+14 -14
encoding/jsonschema/testdata/external/tests/draft2020-12/items.json
··· 127 127 ] 128 128 }, 129 129 "skip": { 130 - "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:12\n", 131 - "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:12\n" 130 + "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:10:12\n", 131 + "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:10:12\n" 132 132 }, 133 133 "tests": [ 134 134 { ··· 461 461 "data": [], 462 462 "valid": true, 463 463 "skip": { 464 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:61\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 465 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:61\n instance.json:1:1\nincompatible list lengths (0 and 4):\n generated.cue:2:33\nexplicit error (_|_ literal) in source:\n generated.cue:2:54\n" 464 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:61\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 465 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:61\n instance.json:1:1\nincompatible list lengths (0 and 4):\n generated.cue:3:33\nexplicit error (_|_ literal) in source:\n generated.cue:3:54\n" 466 466 } 467 467 }, 468 468 { ··· 472 472 ], 473 473 "valid": true, 474 474 "skip": { 475 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:61\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 476 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:61\n instance.json:1:1\nincompatible list lengths (1 and 4):\n generated.cue:2:33\nexplicit error (_|_ literal) in source:\n generated.cue:2:54\n" 475 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:61\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 476 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:61\n instance.json:1:1\nincompatible list lengths (1 and 4):\n generated.cue:3:33\nexplicit error (_|_ literal) in source:\n generated.cue:3:54\n" 477 477 } 478 478 }, 479 479 { ··· 484 484 ], 485 485 "valid": true, 486 486 "skip": { 487 - "v2": "5 errors in empty disjunction:\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:61\n instance.json:1:1\nconflicting values bool and [1,2] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1,2] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1,2] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1,2] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 488 - "v3": "conflicting values [1,2] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1,2] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1,2] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1,2] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:2:61\n instance.json:1:1\nincompatible list lengths (2 and 4):\n generated.cue:2:33\nexplicit error (_|_ literal) in source:\n generated.cue:2:54\n" 487 + "v2": "5 errors in empty disjunction:\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:61\n instance.json:1:1\nconflicting values bool and [1,2] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1,2] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1,2] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1,2] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 488 + "v3": "conflicting values [1,2] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1,2] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1,2] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1,2] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1,2] and {...} (mismatched types list and struct):\n generated.cue:3:61\n instance.json:1:1\nincompatible list lengths (2 and 4):\n generated.cue:3:33\nexplicit error (_|_ literal) in source:\n generated.cue:3:54\n" 489 489 } 490 490 }, 491 491 { ··· 497 497 ], 498 498 "valid": true, 499 499 "skip": { 500 - "v2": "6 errors in empty disjunction:\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:61\n instance.json:1:1\nconflicting values bool and [1,2,3] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1,2,3] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1,2,3] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1,2,3] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:54\n", 501 - "v3": "conflicting values [1,2,3] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1,2,3] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1,2,3] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1,2,3] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n generated.cue:2:61\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:54\n" 500 + "v2": "6 errors in empty disjunction:\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:61\n instance.json:1:1\nconflicting values bool and [1,2,3] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1,2,3] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1,2,3] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1,2,3] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:54\n", 501 + "v3": "conflicting values [1,2,3] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1,2,3] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1,2,3] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1,2,3] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1,2,3] and {...} (mismatched types list and struct):\n generated.cue:3:61\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:54\n" 502 502 } 503 503 }, 504 504 { ··· 572 572 ], 573 573 "valid": true, 574 574 "skip": { 575 - "v2": "6 errors in empty disjunction:\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:60\n instance.json:1:1\nconflicting values bool and [\"x\",2,3] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [\"x\",2,3] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [\"x\",2,3] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [\"x\",2,3] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n0: conflicting values \"x\" and int (mismatched types string and int):\n generated.cue:2:1\n generated.cue:2:50\n generated.cue:2:53\n instance.json:1:2\n", 576 - "v3": "conflicting values \"x\" and int (mismatched types string and int):\n generated.cue:2:53\n instance.json:1:2\nconflicting values [\"x\",2,3] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [\"x\",2,3] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [\"x\",2,3] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [\"x\",2,3] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n generated.cue:2:60\n instance.json:1:1\n" 575 + "v2": "6 errors in empty disjunction:\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:60\n instance.json:1:1\nconflicting values bool and [\"x\",2,3] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [\"x\",2,3] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [\"x\",2,3] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [\"x\",2,3] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n0: conflicting values \"x\" and int (mismatched types string and int):\n generated.cue:3:1\n generated.cue:3:50\n generated.cue:3:53\n instance.json:1:2\n", 576 + "v3": "conflicting values \"x\" and int (mismatched types string and int):\n generated.cue:3:53\n instance.json:1:2\nconflicting values [\"x\",2,3] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [\"x\",2,3] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [\"x\",2,3] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [\"x\",2,3] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [\"x\",2,3] and {...} (mismatched types list and struct):\n generated.cue:3:60\n instance.json:1:1\n" 577 577 } 578 578 }, 579 579 { ··· 612 612 ], 613 613 "valid": true, 614 614 "skip": { 615 - "v2": "6 errors in empty disjunction:\nconflicting values [null] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:55\n instance.json:1:1\nconflicting values bool and [null] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [null] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [null] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [null] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:48\n", 616 - "v3": "conflicting values [null] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [null] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [null] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [null] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [null] and {...} (mismatched types list and struct):\n generated.cue:2:55\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:48\n" 615 + "v2": "6 errors in empty disjunction:\nconflicting values [null] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:55\n instance.json:1:1\nconflicting values bool and [null] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [null] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [null] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [null] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:48\n", 616 + "v3": "conflicting values [null] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [null] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [null] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [null] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [null] and {...} (mismatched types list and struct):\n generated.cue:3:55\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:48\n" 617 617 } 618 618 } 619 619 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/not.json
··· 280 280 ], 281 281 "valid": true, 282 282 "skip": { 283 - "v2": "invalid value [\"foo\"] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:2:1\n generated.cue:1:1\n generated.cue:2:8\n instance.json:1:1\n" 283 + "v2": "invalid value [\"foo\"] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:3:1\n generated.cue:1:1\n generated.cue:3:8\n instance.json:1:1\n" 284 284 } 285 285 }, 286 286 { ··· 288 288 "data": [], 289 289 "valid": true, 290 290 "skip": { 291 - "v2": "invalid value [] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:2:1\n generated.cue:1:1\n generated.cue:2:8\n instance.json:1:1\n" 291 + "v2": "invalid value [] (does not satisfy matchN): 0 matched, expected 0:\n generated.cue:3:1\n generated.cue:1:1\n generated.cue:3:8\n instance.json:1:1\n" 292 292 } 293 293 } 294 294 ]
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/anchor.json
··· 34 34 ] 35 35 }, 36 36 "skip": { 37 - "v2": "extract error: keyword \"$anchor\" not yet implemented (and 1 more errors)", 38 - "v3": "extract error: keyword \"$anchor\" not yet implemented (and 1 more errors)" 37 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#my_anchor: anchors (my_anchor) not supported (and 1 more errors)", 38 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://cue.jsonschema.invalid#my_anchor: anchors (my_anchor) not supported (and 1 more errors)" 39 39 }, 40 40 "tests": [ 41 41 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/dynamicRef.json
··· 42 42 } 43 43 }, 44 44 "skip": { 45 - "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 2 more errors)", 46 - "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 2 more errors)" 45 + "v2": "extract error: keyword \"$dynamicRef\" not yet implemented (and 5 more errors)", 46 + "v3": "extract error: keyword \"$dynamicRef\" not yet implemented (and 5 more errors)" 47 47 }, 48 48 "tests": [ 49 49 {
+10 -10
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/ecmascript-regex.json
··· 216 216 "data": "\u000b", 217 217 "valid": true, 218 218 "skip": { 219 - "v2": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 220 - "v3": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 219 + "v2": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 220 + "v3": "invalid value \"\\v\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 221 221 } 222 222 }, 223 223 { ··· 230 230 "data": " ", 231 231 "valid": true, 232 232 "skip": { 233 - "v2": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 234 - "v3": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 233 + "v2": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 234 + "v3": "invalid value \"\\u00a0\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 235 235 } 236 236 }, 237 237 { ··· 239 239 "data": "\ufeff", 240 240 "valid": true, 241 241 "skip": { 242 - "v2": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 243 - "v3": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 242 + "v2": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 243 + "v3": "invalid value \"\\ufeff\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 244 244 } 245 245 }, 246 246 { ··· 253 253 "data": "\u2029", 254 254 "valid": true, 255 255 "skip": { 256 - "v2": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 257 - "v3": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 256 + "v2": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 257 + "v3": "invalid value \"\\u2029\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 258 258 } 259 259 }, 260 260 { ··· 262 262 "data": " ", 263 263 "valid": true, 264 264 "skip": { 265 - "v2": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n", 266 - "v3": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:2:1\n generated.cue:1:1\n instance.json:1:1\n" 265 + "v2": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n", 266 + "v3": "invalid value \"\\u2003\" (out of bound =~\"^\\\\s$\"):\n generated.cue:3:1\n generated.cue:1:1\n instance.json:1:1\n" 267 267 } 268 268 }, 269 269 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/float-overflow.json
··· 12 12 "data": 1E+308, 13 13 "valid": true, 14 14 "skip": { 15 - "v2": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:4:1\n instance.json:1:1\n", 16 - "v3": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:4:1\n instance.json:1:1\n" 15 + "v2": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:5:1\n instance.json:1:1\n", 16 + "v3": "conflicting values 1E+308 and int (mismatched types float and int):\n generated.cue:5:1\n instance.json:1:1\n" 17 17 } 18 18 } 19 19 ]
+4 -4
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format-assertion.json
··· 7 7 "format": "ipv4" 8 8 }, 9 9 "skip": { 10 - "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-false.json\": $schema URI not recognized", 11 - "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-false.json\": $schema URI not recognized" 10 + "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-false.json\": $schema URI not recognized (and 1 more errors)", 11 + "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-false.json\": $schema URI not recognized (and 1 more errors)" 12 12 }, 13 13 "tests": [ 14 14 { ··· 39 39 "format": "ipv4" 40 40 }, 41 41 "skip": { 42 - "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-true.json\": $schema URI not recognized", 43 - "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-true.json\": $schema URI not recognized" 42 + "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-true.json\": $schema URI not recognized (and 1 more errors)", 43 + "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/format-assertion-true.json\": $schema URI not recognized (and 1 more errors)" 44 44 }, 45 45 "tests": [ 46 46 {
+6 -6
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json
··· 61 61 "data": "1998-12-31T23:59:60Z", 62 62 "valid": true, 63 63 "skip": { 64 - "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", 65 - "v3": "conflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" 64 + "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", 65 + "v3": "conflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" 66 66 } 67 67 }, 68 68 { ··· 70 70 "data": "1998-12-31T15:59:60.123-08:00", 71 71 "valid": true, 72 72 "skip": { 73 - "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 74 - "v3": "conflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 73 + "v2": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", 74 + "v3": "conflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" 75 75 } 76 76 }, 77 77 { ··· 118 118 "data": "1963-06-19t08:30:06.283185z", 119 119 "valid": true, 120 120 "skip": { 121 - "v2": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:4:1\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:4:1\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:4:1\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:4:1\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", 122 - "v3": "conflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:4:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:4:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" 121 + "v2": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", 122 + "v3": "conflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" 123 123 } 124 124 }, 125 125 {
+3 -19
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/id.json
··· 33 33 } 34 34 ] 35 35 }, 36 - "skip": { 37 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2020-12/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 38 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2020-12/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 39 - }, 40 36 "tests": [ 41 37 { 42 38 "description": "exact match to enum, and type matches", ··· 44 40 "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json", 45 41 "type": "null" 46 42 }, 47 - "valid": true, 48 - "skip": { 49 - "v2": "could not compile schema", 50 - "v3": "could not compile schema" 51 - } 43 + "valid": true 52 44 }, 53 45 { 54 46 "description": "match $ref to $id", 55 47 "data": "a string to match #/$defs/id_in_enum", 56 - "valid": true, 57 - "skip": { 58 - "v2": "could not compile schema", 59 - "v3": "could not compile schema" 60 - } 48 + "valid": true 61 49 }, 62 50 { 63 51 "description": "no match on enum or $ref to $id", 64 52 "data": 1, 65 - "valid": false, 66 - "skip": { 67 - "v2": "could not compile schema", 68 - "v3": "could not compile schema" 69 - } 53 + "valid": false 70 54 } 71 55 ] 72 56 }
+6 -42
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/refOfUnknownKeyword.json
··· 12 12 } 13 13 } 14 14 }, 15 - "skip": { 16 - "v2": "extract error: cannot compile resulting schema: bar: reference \"_X0\" not found:\n generated.cue:3:8\n", 17 - "v3": "extract error: cannot compile resulting schema: bar: reference \"_X0\" not found:\n generated.cue:3:8\n" 18 - }, 19 15 "tests": [ 20 16 { 21 17 "description": "match", 22 18 "data": { 23 19 "bar": 3 24 20 }, 25 - "valid": true, 26 - "skip": { 27 - "v2": "could not compile schema", 28 - "v3": "could not compile schema" 29 - } 21 + "valid": true 30 22 }, 31 23 { 32 24 "description": "mismatch", 33 25 "data": { 34 26 "bar": true 35 27 }, 36 - "valid": false, 37 - "skip": { 38 - "v2": "could not compile schema", 39 - "v3": "could not compile schema" 40 - } 28 + "valid": false 41 29 } 42 30 ] 43 31 }, ··· 56 44 } 57 45 } 58 46 }, 59 - "skip": { 60 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 61 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 62 - }, 63 47 "tests": [ 64 48 { 65 49 "description": "match", 66 50 "data": { 67 51 "bar": 3 68 52 }, 69 - "valid": true, 70 - "skip": { 71 - "v2": "could not compile schema", 72 - "v3": "could not compile schema" 73 - } 53 + "valid": true 74 54 }, 75 55 { 76 56 "description": "mismatch", 77 57 "data": { 78 58 "bar": true 79 59 }, 80 - "valid": false, 81 - "skip": { 82 - "v2": "could not compile schema", 83 - "v3": "could not compile schema" 84 - } 60 + "valid": false 85 61 } 86 62 ] 87 63 }, ··· 96 72 } 97 73 ], 98 74 "$ref": "#/examples/0" 99 - }, 100 - "skip": { 101 - "v2": "extract error: reference to non-existing value \"examples\"", 102 - "v3": "extract error: reference to non-existing value \"examples\"" 103 75 }, 104 76 "tests": [ 105 77 { 106 78 "description": "match", 107 79 "data": "a string", 108 - "valid": true, 109 - "skip": { 110 - "v2": "could not compile schema", 111 - "v3": "could not compile schema" 112 - } 80 + "valid": true 113 81 }, 114 82 { 115 83 "description": "mismatch", 116 84 "data": 42, 117 - "valid": false, 118 - "skip": { 119 - "v2": "could not compile schema", 120 - "v3": "could not compile schema" 121 - } 85 + "valid": false 122 86 } 123 87 ] 124 88 }
+3 -19
encoding/jsonschema/testdata/external/tests/draft2020-12/optional/unknownKeyword.json
··· 42 42 } 43 43 ] 44 44 }, 45 - "skip": { 46 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2020-12/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 47 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/draft2020-12/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 48 - }, 49 45 "tests": [ 50 46 { 51 47 "description": "type matches second anyOf, which has a real schema in it", 52 48 "data": "a string", 53 - "valid": true, 54 - "skip": { 55 - "v2": "could not compile schema", 56 - "v3": "could not compile schema" 57 - } 49 + "valid": true 58 50 }, 59 51 { 60 52 "description": "type matches non-schema in first anyOf", 61 53 "data": null, 62 - "valid": false, 63 - "skip": { 64 - "v2": "could not compile schema", 65 - "v3": "could not compile schema" 66 - } 54 + "valid": false 67 55 }, 68 56 { 69 57 "description": "type matches non-schema in third anyOf", 70 58 "data": 1, 71 - "valid": false, 72 - "skip": { 73 - "v2": "could not compile schema", 74 - "v3": "could not compile schema" 75 - } 59 + "valid": false 76 60 } 77 61 ] 78 62 }
+8 -8
encoding/jsonschema/testdata/external/tests/draft2020-12/prefixItems.json
··· 36 36 ], 37 37 "valid": true, 38 38 "skip": { 39 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:54\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 40 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:54\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:2:33\n" 39 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:54\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 40 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:54\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:3:33\n" 41 41 } 42 42 }, 43 43 { ··· 54 54 "data": [], 55 55 "valid": true, 56 56 "skip": { 57 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:54\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 58 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:54\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:2:33\n" 57 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:54\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 58 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:54\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:3:33\n" 59 59 } 60 60 }, 61 61 { ··· 86 86 ], 87 87 "valid": true, 88 88 "skip": { 89 - "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:49\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 90 - "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:2:49\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:2:33\nexplicit error (_|_ literal) in source:\n generated.cue:2:37\n" 89 + "v2": "5 errors in empty disjunction:\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:49\n instance.json:1:1\nconflicting values bool and [1] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [1] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [1] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [1] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 90 + "v3": "conflicting values [1] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [1] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [1] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [1] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [1] and {...} (mismatched types list and struct):\n generated.cue:3:49\n instance.json:1:1\nincompatible list lengths (1 and 3):\n generated.cue:3:33\nexplicit error (_|_ literal) in source:\n generated.cue:3:37\n" 91 91 } 92 92 }, 93 93 { ··· 103 103 "data": [], 104 104 "valid": true, 105 105 "skip": { 106 - "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:49\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\n", 107 - "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:2:49\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:2:33\n" 106 + "v2": "5 errors in empty disjunction:\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:49\n instance.json:1:1\nconflicting values bool and [] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\n", 107 + "v3": "conflicting values [] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [] and {...} (mismatched types list and struct):\n generated.cue:3:49\n instance.json:1:1\nincompatible list lengths (0 and 3):\n generated.cue:3:33\n" 108 108 } 109 109 } 110 110 ]
+3 -3
encoding/jsonschema/testdata/external/tests/draft2020-12/propertyNames.json
··· 8 8 } 9 9 }, 10 10 "skip": { 11 - "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:5:3\n", 12 - "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:5:3\n" 11 + "v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:6:3\n", 12 + "v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n generated.cue:6:3\n" 13 13 }, 14 14 "tests": [ 15 15 { ··· 122 122 "data": {}, 123 123 "valid": true, 124 124 "skip": { 125 - "v3": "conflicting values [...] and {} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:3\n" 125 + "v3": "conflicting values [...] and {} (mismatched types list and struct):\n generated.cue:3:33\n instance.json:1:1\nconflicting values bool and {} (mismatched types bool and struct):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and {} (mismatched types null and struct):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and {} (mismatched types number and struct):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and {} (mismatched types string and struct):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:3\n" 126 126 } 127 127 } 128 128 ]
+38 -184
encoding/jsonschema/testdata/external/tests/draft2020-12/ref.json
··· 64 64 } 65 65 } 66 66 }, 67 - "skip": { 68 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 69 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 70 - }, 71 67 "tests": [ 72 68 { 73 69 "description": "match", 74 70 "data": { 75 71 "bar": 3 76 72 }, 77 - "valid": true, 78 - "skip": { 79 - "v2": "could not compile schema", 80 - "v3": "could not compile schema" 81 - } 73 + "valid": true 82 74 }, 83 75 { 84 76 "description": "mismatch", 85 77 "data": { 86 78 "bar": true 87 79 }, 88 - "valid": false, 89 - "skip": { 90 - "v2": "could not compile schema", 91 - "v3": "could not compile schema" 92 - } 80 + "valid": false 93 81 } 94 82 ] 95 83 }, ··· 106 94 } 107 95 ] 108 96 }, 109 - "skip": { 110 - "v2": "extract error: cannot compile resulting schema: reference \"prefixItems\" not found:\n generated.cue:2:39\n", 111 - "v3": "extract error: cannot compile resulting schema: reference \"prefixItems\" not found:\n generated.cue:2:39\n" 112 - }, 113 97 "tests": [ 114 98 { 115 99 "description": "match array", ··· 117 101 1, 118 102 2 119 103 ], 120 - "valid": true, 121 - "skip": { 122 - "v2": "could not compile schema", 123 - "v3": "could not compile schema" 124 - } 104 + "valid": true 125 105 }, 126 106 { 127 107 "description": "mismatch array", ··· 129 109 1, 130 110 "foo" 131 111 ], 132 - "valid": false, 133 - "skip": { 134 - "v2": "could not compile schema", 135 - "v3": "could not compile schema" 136 - } 112 + "valid": false 137 113 } 138 114 ] 139 115 }, ··· 170 146 "data": { 171 147 "slash": "aoeu" 172 148 }, 173 - "valid": false, 174 - "skip": { 175 - "v3": "unexpected success" 176 - } 149 + "valid": false 177 150 }, 178 151 { 179 152 "description": "tilde invalid", 180 153 "data": { 181 154 "tilde": "aoeu" 182 155 }, 183 - "valid": false, 184 - "skip": { 185 - "v3": "unexpected success" 186 - } 156 + "valid": false 187 157 }, 188 158 { 189 159 "description": "percent invalid", 190 160 "data": { 191 161 "percent": "aoeu" 192 162 }, 193 - "valid": false, 194 - "skip": { 195 - "v3": "unexpected success" 196 - } 163 + "valid": false 197 164 }, 198 165 { 199 166 "description": "slash valid", 200 167 "data": { 201 168 "slash": 123 202 169 }, 203 - "valid": true, 204 - "skip": { 205 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {slash:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {slash:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {slash:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {slash:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {slash:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nslash: undefined field: \"slash~1field\":\n generated.cue:4:14\n" 206 - } 170 + "valid": true 207 171 }, 208 172 { 209 173 "description": "tilde valid", 210 174 "data": { 211 175 "tilde": 123 212 176 }, 213 - "valid": true, 214 - "skip": { 215 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {tilde:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {tilde:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {tilde:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {tilde:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {tilde:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\ntilde: undefined field: \"tilde~0field\":\n generated.cue:3:14\n" 216 - } 177 + "valid": true 217 178 }, 218 179 { 219 180 "description": "percent valid", 220 181 "data": { 221 182 "percent": 123 222 183 }, 223 - "valid": true, 224 - "skip": { 225 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {percent:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {percent:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {percent:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {percent:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {percent:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\npercent: undefined field: \"percent%25field\":\n generated.cue:5:14\n" 226 - } 184 + "valid": true 227 185 } 228 186 ] 229 187 }, ··· 422 380 } 423 381 }, 424 382 "skip": { 425 - "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:8\n", 426 - "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:4:8\n" 383 + "v2": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:5:8\n", 384 + "v3": "extract error: cannot compile resulting schema: explicit error (_|_ literal) in source:\n generated.cue:5:8\n" 427 385 }, 428 386 "tests": [ 429 387 { ··· 478 436 } 479 437 } 480 438 }, 481 - "skip": { 482 - "v2": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/draft2020-12/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:9:14\n", 483 - "v3": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/draft2020-12/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:9:14\n" 484 - }, 485 439 "tests": [ 486 440 { 487 441 "description": "valid tree", ··· 518 472 } 519 473 ] 520 474 }, 521 - "valid": true, 522 - "skip": { 523 - "v2": "could not compile schema", 524 - "v3": "could not compile schema" 525 - } 475 + "valid": true 526 476 }, 527 477 { 528 478 "description": "invalid tree", ··· 559 509 } 560 510 ] 561 511 }, 562 - "valid": false, 563 - "skip": { 564 - "v2": "could not compile schema", 565 - "v3": "could not compile schema" 566 - } 512 + "valid": false 567 513 } 568 514 ] 569 515 }, ··· 588 534 "data": { 589 535 "foo\"bar": 1 590 536 }, 591 - "valid": true, 592 - "skip": { 593 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {\"foo\\\"bar\":1} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {\"foo\\\"bar\":1} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {\"foo\\\"bar\":1} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {\"foo\\\"bar\":1} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {\"foo\\\"bar\":1} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\n\"foo\\\"bar\": undefined field: \"foo%22bar\":\n generated.cue:3:17\n" 594 - } 537 + "valid": true 595 538 }, 596 539 { 597 540 "description": "object with strings is invalid", 598 541 "data": { 599 542 "foo\"bar": "1" 600 543 }, 601 - "valid": false, 602 - "skip": { 603 - "v3": "unexpected success" 604 - } 544 + "valid": false 605 545 } 606 546 ] 607 547 }, ··· 622 562 "$ref": "#/$defs/A" 623 563 }, 624 564 "skip": { 625 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 626 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 565 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 566 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 627 567 }, 628 568 "tests": [ 629 569 { ··· 698 638 }, 699 639 "$ref": "schema-relative-uri-defs2.json" 700 640 }, 701 - "skip": { 702 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 703 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 704 - }, 705 641 "tests": [ 706 642 { 707 643 "description": "invalid on inner field", ··· 711 647 }, 712 648 "bar": "a" 713 649 }, 714 - "valid": false, 715 - "skip": { 716 - "v2": "could not compile schema", 717 - "v3": "could not compile schema" 718 - } 650 + "valid": false 719 651 }, 720 652 { 721 653 "description": "invalid on outer field", ··· 725 657 }, 726 658 "bar": 1 727 659 }, 728 - "valid": false, 729 - "skip": { 730 - "v2": "could not compile schema", 731 - "v3": "could not compile schema" 732 - } 660 + "valid": false 733 661 }, 734 662 { 735 663 "description": "valid on both fields", ··· 739 667 }, 740 668 "bar": "a" 741 669 }, 742 - "valid": true, 743 - "skip": { 744 - "v2": "could not compile schema", 745 - "v3": "could not compile schema" 746 - } 670 + "valid": true 747 671 } 748 672 ] 749 673 }, ··· 769 693 }, 770 694 "$ref": "schema-refs-absolute-uris-defs2.json" 771 695 }, 772 - "skip": { 773 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 774 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 775 - }, 776 696 "tests": [ 777 697 { 778 698 "description": "invalid on inner field", ··· 782 702 }, 783 703 "bar": "a" 784 704 }, 785 - "valid": false, 786 - "skip": { 787 - "v2": "could not compile schema", 788 - "v3": "could not compile schema" 789 - } 705 + "valid": false 790 706 }, 791 707 { 792 708 "description": "invalid on outer field", ··· 796 712 }, 797 713 "bar": 1 798 714 }, 799 - "valid": false, 800 - "skip": { 801 - "v2": "could not compile schema", 802 - "v3": "could not compile schema" 803 - } 715 + "valid": false 804 716 }, 805 717 { 806 718 "description": "valid on both fields", ··· 810 722 }, 811 723 "bar": "a" 812 724 }, 813 - "valid": true, 814 - "skip": { 815 - "v2": "could not compile schema", 816 - "v3": "could not compile schema" 817 - } 725 + "valid": true 818 726 } 819 727 ] 820 728 }, ··· 842 750 } 843 751 ] 844 752 }, 845 - "skip": { 846 - "v2": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n", 847 - "v3": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n" 848 - }, 849 753 "tests": [ 850 754 { 851 755 "description": "number is valid", 852 756 "data": 1, 853 - "valid": true, 854 - "skip": { 855 - "v2": "could not compile schema", 856 - "v3": "could not compile schema" 857 - } 757 + "valid": true 858 758 }, 859 759 { 860 760 "description": "non-number is invalid", 861 761 "data": "a", 862 - "valid": false, 863 - "skip": { 864 - "v2": "could not compile schema", 865 - "v3": "could not compile schema" 866 - } 762 + "valid": false 867 763 } 868 764 ] 869 765 }, ··· 887 783 } 888 784 } 889 785 }, 890 - "skip": { 891 - "v2": "extract error: cannot compile resulting schema: package \"example.com/draft2020-12/ref-and-id1/int.json:int\" imported but not defined in :\n generated.cue:1:8\n", 892 - "v3": "extract error: cannot compile resulting schema: package \"example.com/draft2020-12/ref-and-id1/int.json:int\" imported but not defined in :\n generated.cue:1:8\n" 893 - }, 894 786 "tests": [ 895 787 { 896 788 "description": "data is valid against first definition", 897 789 "data": 5, 898 - "valid": true, 899 - "skip": { 900 - "v2": "could not compile schema", 901 - "v3": "could not compile schema" 902 - } 790 + "valid": true 903 791 }, 904 792 { 905 793 "description": "data is invalid against first definition", 906 794 "data": 50, 907 - "valid": false, 908 - "skip": { 909 - "v2": "could not compile schema", 910 - "v3": "could not compile schema" 911 - } 795 + "valid": false 912 796 } 913 797 ] 914 798 }, ··· 934 818 } 935 819 }, 936 820 "skip": { 937 - "v2": "extract error: anchors (bigint) not supported (and 2 more errors)", 938 - "v3": "extract error: anchors (bigint) not supported (and 2 more errors)" 821 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=https://example.com/draft2020-12/ref-and-id2/base.json#bigint: anchors (bigint) not supported (and 1 more errors)", 822 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=https://example.com/draft2020-12/ref-and-id2/base.json#bigint: anchors (bigint) not supported (and 1 more errors)" 939 823 }, 940 824 "tests": [ 941 825 { ··· 1175 1059 } 1176 1060 }, 1177 1061 "skip": { 1178 - "v2": "extract error: anchors (something) not supported (and 1 more errors)", 1179 - "v3": "extract error: anchors (something) not supported (and 1 more errors)" 1062 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 1 more errors)", 1063 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 1 more errors)" 1180 1064 }, 1181 1065 "tests": [ 1182 1066 { ··· 1224 1108 { 1225 1109 "description": "a string is valid", 1226 1110 "data": "bar", 1227 - "valid": true, 1228 - "skip": { 1229 - "v2": "conflicting values \"bar\" and {_schema:{#foo:string},#foo:string} (mismatched types string and struct):\n generated.cue:2:1\n instance.json:1:1\n" 1230 - } 1111 + "valid": true 1231 1112 }, 1232 1113 { 1233 1114 "description": "a non-string is invalid", 1234 1115 "data": 12, 1235 - "valid": false, 1236 - "skip": { 1237 - "v3": "unexpected success" 1238 - } 1116 + "valid": false 1239 1117 } 1240 1118 ] 1241 1119 }, ··· 1361 1239 }, 1362 1240 "$ref": "/absref/foobar.json" 1363 1241 }, 1364 - "skip": { 1365 - "v2": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n", 1366 - "v3": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n" 1367 - }, 1368 1242 "tests": [ 1369 1243 { 1370 1244 "description": "a string is valid", 1371 1245 "data": "foo", 1372 - "valid": true, 1373 - "skip": { 1374 - "v2": "could not compile schema", 1375 - "v3": "could not compile schema" 1376 - } 1246 + "valid": true 1377 1247 }, 1378 1248 { 1379 1249 "description": "an integer is invalid", 1380 1250 "data": 12, 1381 - "valid": false, 1382 - "skip": { 1383 - "v2": "could not compile schema", 1384 - "v3": "could not compile schema" 1385 - } 1251 + "valid": false 1386 1252 } 1387 1253 ] 1388 1254 }, ··· 1455 1321 } 1456 1322 ] 1457 1323 }, 1458 - "skip": { 1459 - "v2": "extract error: cannot refer to $defs section: must refer to one of its elements", 1460 - "v3": "extract error: cannot refer to $defs section: must refer to one of its elements" 1461 - }, 1462 1324 "tests": [ 1463 1325 { 1464 1326 "description": "number is valid", 1465 1327 "data": 1, 1466 - "valid": true, 1467 - "skip": { 1468 - "v2": "could not compile schema", 1469 - "v3": "could not compile schema" 1470 - } 1328 + "valid": true 1471 1329 }, 1472 1330 { 1473 1331 "description": "non-number is invalid", 1474 1332 "data": "a", 1475 - "valid": false, 1476 - "skip": { 1477 - "v2": "could not compile schema", 1478 - "v3": "could not compile schema" 1479 - } 1333 + "valid": false 1480 1334 } 1481 1335 ] 1482 1336 }
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/refRemote.json
··· 68 68 "$ref": "http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#foo" 69 69 }, 70 70 "skip": { 71 - "v2": "extract error: anchors (foo) not supported", 72 - "v3": "extract error: anchors (foo) not supported" 71 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#foo: anchors (foo) not supported", 72 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=http://localhost:1234/draft2020-12/locationIndependentIdentifier.json#foo: anchors (foo) not supported" 73 73 }, 74 74 "tests": [ 75 75 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/type.json
··· 16 16 "data": 1.0, 17 17 "valid": true, 18 18 "skip": { 19 - "v2": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n", 20 - "v3": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:2:1\n instance.json:1:1\n" 19 + "v2": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n", 20 + "v3": "conflicting values 1.0 and int (mismatched types float and int):\n generated.cue:3:1\n instance.json:1:1\n" 21 21 } 22 22 }, 23 23 {
+6 -6
encoding/jsonschema/testdata/external/tests/draft2020-12/unevaluatedItems.json
··· 815 815 } 816 816 }, 817 817 "skip": { 818 - "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented", 819 - "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented" 818 + "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)", 819 + "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)" 820 820 }, 821 821 "tests": [ 822 822 { ··· 869 869 } 870 870 }, 871 871 "skip": { 872 - "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented", 873 - "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented" 872 + "v2": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)", 873 + "v3": "extract error: keyword \"unevaluatedItems\" not yet implemented (and 1 more errors)" 874 874 }, 875 875 "tests": [ 876 876 { ··· 937 937 } 938 938 }, 939 939 "skip": { 940 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 941 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 940 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 7 more errors)", 941 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 7 more errors)" 942 942 }, 943 943 "tests": [ 944 944 {
+10 -10
encoding/jsonschema/testdata/external/tests/draft2020-12/unevaluatedProperties.json
··· 1034 1034 } 1035 1035 }, 1036 1036 "skip": { 1037 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1038 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1037 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1038 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1039 1039 }, 1040 1040 "tests": [ 1041 1041 { ··· 1088 1088 } 1089 1089 }, 1090 1090 "skip": { 1091 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1092 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1091 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1092 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1093 1093 }, 1094 1094 "tests": [ 1095 1095 { ··· 1155 1155 } 1156 1156 }, 1157 1157 "skip": { 1158 - "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)", 1159 - "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 3 more errors)" 1158 + "v2": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 7 more errors)", 1159 + "v3": "extract error: keyword \"$dynamicAnchor\" not yet implemented (and 7 more errors)" 1160 1160 }, 1161 1161 "tests": [ 1162 1162 { ··· 1883 1883 "unevaluatedProperties": false 1884 1884 }, 1885 1885 "skip": { 1886 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented", 1887 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented" 1886 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 1887 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 1888 1888 }, 1889 1889 "tests": [ 1890 1890 { ··· 2057 2057 "unevaluatedProperties": false 2058 2058 }, 2059 2059 "skip": { 2060 - "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)", 2061 - "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 1 more errors)" 2060 + "v2": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 3 more errors)", 2061 + "v3": "extract error: keyword \"unevaluatedProperties\" not yet implemented (and 3 more errors)" 2062 2062 }, 2063 2063 "tests": [ 2064 2064 {
+12 -12
encoding/jsonschema/testdata/external/tests/draft2020-12/uniqueItems.json
··· 462 462 ], 463 463 "valid": true, 464 464 "skip": { 465 - "v2": "7 errors in empty disjunction:\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:4:1\n generated.cue:4:85\n instance.json:1:1\nconflicting values bool and [false,true] (mismatched types bool and list):\n generated.cue:4:8\n instance.json:1:1\nconflicting values null and [false,true] (mismatched types null and list):\n generated.cue:4:1\n instance.json:1:1\nconflicting values number and [false,true] (mismatched types number and list):\n generated.cue:4:15\n instance.json:1:1\nconflicting values string and [false,true] (mismatched types string and list):\n generated.cue:4:24\n instance.json:1:1\ninvalid value [_|_(explicit error (_|_ literal) in source),_|_(explicit error (_|_ literal) in source)] (does not satisfy list.UniqueItems): equal values at position 0 and 1:\n generated.cue:4:33\n generated.cue:1:1\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:78\n", 466 - "v3": "conflicting values [false,true] and bool (mismatched types list and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values [false,true] and null (mismatched types list and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values [false,true] and number (mismatched types list and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values [false,true] and string (mismatched types list and string):\n generated.cue:4:24\n instance.json:1:1\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:4:85\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:78\n" 465 + "v2": "7 errors in empty disjunction:\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:5:1\n generated.cue:5:85\n instance.json:1:1\nconflicting values bool and [false,true] (mismatched types bool and list):\n generated.cue:5:8\n instance.json:1:1\nconflicting values null and [false,true] (mismatched types null and list):\n generated.cue:5:1\n instance.json:1:1\nconflicting values number and [false,true] (mismatched types number and list):\n generated.cue:5:15\n instance.json:1:1\nconflicting values string and [false,true] (mismatched types string and list):\n generated.cue:5:24\n instance.json:1:1\ninvalid value [_|_(explicit error (_|_ literal) in source),_|_(explicit error (_|_ literal) in source)] (does not satisfy list.UniqueItems): equal values at position 0 and 1:\n generated.cue:5:33\n generated.cue:1:1\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:78\n", 466 + "v3": "conflicting values [false,true] and bool (mismatched types list and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values [false,true] and null (mismatched types list and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values [false,true] and number (mismatched types list and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values [false,true] and string (mismatched types list and string):\n generated.cue:5:24\n instance.json:1:1\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:5:85\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:78\n" 467 467 } 468 468 }, 469 469 { ··· 474 474 ], 475 475 "valid": true, 476 476 "skip": { 477 - "v2": "7 errors in empty disjunction:\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:4:1\n generated.cue:4:85\n instance.json:1:1\nconflicting values bool and [true,false] (mismatched types bool and list):\n generated.cue:4:8\n instance.json:1:1\nconflicting values null and [true,false] (mismatched types null and list):\n generated.cue:4:1\n instance.json:1:1\nconflicting values number and [true,false] (mismatched types number and list):\n generated.cue:4:15\n instance.json:1:1\nconflicting values string and [true,false] (mismatched types string and list):\n generated.cue:4:24\n instance.json:1:1\ninvalid value [_|_(explicit error (_|_ literal) in source),_|_(explicit error (_|_ literal) in source)] (does not satisfy list.UniqueItems): equal values at position 0 and 1:\n generated.cue:4:33\n generated.cue:1:1\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:78\n", 478 - "v3": "conflicting values [true,false] and bool (mismatched types list and bool):\n generated.cue:4:8\n instance.json:1:1\nconflicting values [true,false] and null (mismatched types list and null):\n generated.cue:4:1\n instance.json:1:1\nconflicting values [true,false] and number (mismatched types list and number):\n generated.cue:4:15\n instance.json:1:1\nconflicting values [true,false] and string (mismatched types list and string):\n generated.cue:4:24\n instance.json:1:1\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:4:85\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:4:78\n" 477 + "v2": "7 errors in empty disjunction:\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:5:1\n generated.cue:5:85\n instance.json:1:1\nconflicting values bool and [true,false] (mismatched types bool and list):\n generated.cue:5:8\n instance.json:1:1\nconflicting values null and [true,false] (mismatched types null and list):\n generated.cue:5:1\n instance.json:1:1\nconflicting values number and [true,false] (mismatched types number and list):\n generated.cue:5:15\n instance.json:1:1\nconflicting values string and [true,false] (mismatched types string and list):\n generated.cue:5:24\n instance.json:1:1\ninvalid value [_|_(explicit error (_|_ literal) in source),_|_(explicit error (_|_ literal) in source)] (does not satisfy list.UniqueItems): equal values at position 0 and 1:\n generated.cue:5:33\n generated.cue:1:1\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:78\n", 478 + "v3": "conflicting values [true,false] and bool (mismatched types list and bool):\n generated.cue:5:8\n instance.json:1:1\nconflicting values [true,false] and null (mismatched types list and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values [true,false] and number (mismatched types list and number):\n generated.cue:5:15\n instance.json:1:1\nconflicting values [true,false] and string (mismatched types list and string):\n generated.cue:5:24\n instance.json:1:1\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:5:85\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:5:78\n" 479 479 } 480 480 }, 481 481 { ··· 799 799 ], 800 800 "valid": true, 801 801 "skip": { 802 - "v2": "6 errors in empty disjunction:\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:64\n instance.json:1:1\nconflicting values bool and [false,true] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [false,true] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [false,true] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [false,true] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n", 803 - "v3": "conflicting values [false,true] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [false,true] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [false,true] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [false,true] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:2:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n" 802 + "v2": "6 errors in empty disjunction:\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:64\n instance.json:1:1\nconflicting values bool and [false,true] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [false,true] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [false,true] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [false,true] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n", 803 + "v3": "conflicting values [false,true] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [false,true] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [false,true] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [false,true] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [false,true] and {...} (mismatched types list and struct):\n generated.cue:3:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n" 804 804 } 805 805 }, 806 806 { ··· 811 811 ], 812 812 "valid": true, 813 813 "skip": { 814 - "v2": "6 errors in empty disjunction:\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:64\n instance.json:1:1\nconflicting values bool and [true,false] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [true,false] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [true,false] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [true,false] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n", 815 - "v3": "conflicting values [true,false] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [true,false] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [true,false] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [true,false] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:2:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n" 814 + "v2": "6 errors in empty disjunction:\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:64\n instance.json:1:1\nconflicting values bool and [true,false] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [true,false] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [true,false] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [true,false] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n", 815 + "v3": "conflicting values [true,false] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [true,false] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [true,false] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [true,false] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [true,false] and {...} (mismatched types list and struct):\n generated.cue:3:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n" 816 816 } 817 817 }, 818 818 { ··· 823 823 ], 824 824 "valid": true, 825 825 "skip": { 826 - "v2": "6 errors in empty disjunction:\nconflicting values [false,false] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:64\n instance.json:1:1\nconflicting values bool and [false,false] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [false,false] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [false,false] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [false,false] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n", 827 - "v3": "conflicting values [false,false] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [false,false] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [false,false] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [false,false] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [false,false] and {...} (mismatched types list and struct):\n generated.cue:2:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n" 826 + "v2": "6 errors in empty disjunction:\nconflicting values [false,false] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:64\n instance.json:1:1\nconflicting values bool and [false,false] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [false,false] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [false,false] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [false,false] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n", 827 + "v3": "conflicting values [false,false] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [false,false] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [false,false] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [false,false] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [false,false] and {...} (mismatched types list and struct):\n generated.cue:3:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n" 828 828 } 829 829 }, 830 830 { ··· 835 835 ], 836 836 "valid": true, 837 837 "skip": { 838 - "v2": "6 errors in empty disjunction:\nconflicting values [true,true] and {...} (mismatched types list and struct):\n generated.cue:2:1\n generated.cue:2:64\n instance.json:1:1\nconflicting values bool and [true,true] (mismatched types bool and list):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and [true,true] (mismatched types null and list):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and [true,true] (mismatched types number and list):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and [true,true] (mismatched types string and list):\n generated.cue:2:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n", 839 - "v3": "conflicting values [true,true] and bool (mismatched types list and bool):\n generated.cue:2:8\n instance.json:1:1\nconflicting values [true,true] and null (mismatched types list and null):\n generated.cue:2:1\n instance.json:1:1\nconflicting values [true,true] and number (mismatched types list and number):\n generated.cue:2:15\n instance.json:1:1\nconflicting values [true,true] and string (mismatched types list and string):\n generated.cue:2:24\n instance.json:1:1\nconflicting values [true,true] and {...} (mismatched types list and struct):\n generated.cue:2:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:2:57\n" 838 + "v2": "6 errors in empty disjunction:\nconflicting values [true,true] and {...} (mismatched types list and struct):\n generated.cue:3:1\n generated.cue:3:64\n instance.json:1:1\nconflicting values bool and [true,true] (mismatched types bool and list):\n generated.cue:3:8\n instance.json:1:1\nconflicting values null and [true,true] (mismatched types null and list):\n generated.cue:3:1\n instance.json:1:1\nconflicting values number and [true,true] (mismatched types number and list):\n generated.cue:3:15\n instance.json:1:1\nconflicting values string and [true,true] (mismatched types string and list):\n generated.cue:3:24\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n", 839 + "v3": "conflicting values [true,true] and bool (mismatched types list and bool):\n generated.cue:3:8\n instance.json:1:1\nconflicting values [true,true] and null (mismatched types list and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values [true,true] and number (mismatched types list and number):\n generated.cue:3:15\n instance.json:1:1\nconflicting values [true,true] and string (mismatched types list and string):\n generated.cue:3:24\n instance.json:1:1\nconflicting values [true,true] and {...} (mismatched types list and struct):\n generated.cue:3:64\n instance.json:1:1\nexplicit error (_|_ literal) in source:\n generated.cue:3:57\n" 840 840 } 841 841 }, 842 842 {
+2 -2
encoding/jsonschema/testdata/external/tests/draft2020-12/vocabulary.json
··· 12 12 } 13 13 }, 14 14 "skip": { 15 - "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/metaschema-no-validation.json\": $schema URI not recognized", 16 - "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/metaschema-no-validation.json\": $schema URI not recognized" 15 + "v2": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/metaschema-no-validation.json\": $schema URI not recognized (and 1 more errors)", 16 + "v3": "extract error: invalid $schema URL \"http://localhost:1234/draft2020-12/metaschema-no-validation.json\": $schema URI not recognized (and 1 more errors)" 17 17 }, 18 18 "tests": [ 19 19 {
+1 -1
encoding/jsonschema/testdata/external/tests/draft4/items.json
··· 319 319 "valid": true, 320 320 "skip": { 321 321 "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", 322 - "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:4:8\n" 322 + "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:9:8\n" 323 323 } 324 324 } 325 325 ]
+3 -19
encoding/jsonschema/testdata/external/tests/draft4/optional/id.json
··· 32 32 } 33 33 ] 34 34 }, 35 - "skip": { 36 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 37 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 38 - }, 39 35 "tests": [ 40 36 { 41 37 "description": "exact match to enum, and type matches", ··· 43 39 "id": "https://localhost:1234/my_identifier.json", 44 40 "type": "null" 45 41 }, 46 - "valid": true, 47 - "skip": { 48 - "v2": "could not compile schema", 49 - "v3": "could not compile schema" 50 - } 42 + "valid": true 51 43 }, 52 44 { 53 45 "description": "match $ref to id", 54 46 "data": "a string to match #/definitions/id_in_enum", 55 - "valid": true, 56 - "skip": { 57 - "v2": "could not compile schema", 58 - "v3": "could not compile schema" 59 - } 47 + "valid": true 60 48 }, 61 49 { 62 50 "description": "no match on enum or $ref to id", 63 51 "data": 1, 64 - "valid": false, 65 - "skip": { 66 - "v2": "could not compile schema", 67 - "v3": "could not compile schema" 68 - } 52 + "valid": false 69 53 } 70 54 ] 71 55 }
+24 -120
encoding/jsonschema/testdata/external/tests/draft4/ref.json
··· 62 62 } 63 63 } 64 64 }, 65 - "skip": { 66 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 67 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 68 - }, 69 65 "tests": [ 70 66 { 71 67 "description": "match", 72 68 "data": { 73 69 "bar": 3 74 70 }, 75 - "valid": true, 76 - "skip": { 77 - "v2": "could not compile schema", 78 - "v3": "could not compile schema" 79 - } 71 + "valid": true 80 72 }, 81 73 { 82 74 "description": "mismatch", 83 75 "data": { 84 76 "bar": true 85 77 }, 86 - "valid": false, 87 - "skip": { 88 - "v2": "could not compile schema", 89 - "v3": "could not compile schema" 90 - } 78 + "valid": false 91 79 } 92 80 ] 93 81 }, ··· 103 91 } 104 92 ] 105 93 }, 106 - "skip": { 107 - "v2": "extract error: referring to field \"items\" not yet supported", 108 - "v3": "extract error: referring to field \"items\" not yet supported" 109 - }, 110 94 "tests": [ 111 95 { 112 96 "description": "match array", ··· 114 98 1, 115 99 2 116 100 ], 117 - "valid": true, 118 - "skip": { 119 - "v2": "could not compile schema", 120 - "v3": "could not compile schema" 121 - } 101 + "valid": true 122 102 }, 123 103 { 124 104 "description": "mismatch array", ··· 126 106 1, 127 107 "foo" 128 108 ], 129 - "valid": false, 130 - "skip": { 131 - "v2": "could not compile schema", 132 - "v3": "could not compile schema" 133 - } 109 + "valid": false 134 110 } 135 111 ] 136 112 }, ··· 166 142 "data": { 167 143 "slash": "aoeu" 168 144 }, 169 - "valid": false, 170 - "skip": { 171 - "v3": "unexpected success" 172 - } 145 + "valid": false 173 146 }, 174 147 { 175 148 "description": "tilde invalid", 176 149 "data": { 177 150 "tilde": "aoeu" 178 151 }, 179 - "valid": false, 180 - "skip": { 181 - "v3": "unexpected success" 182 - } 152 + "valid": false 183 153 }, 184 154 { 185 155 "description": "percent invalid", 186 156 "data": { 187 157 "percent": "aoeu" 188 158 }, 189 - "valid": false, 190 - "skip": { 191 - "v3": "unexpected success" 192 - } 159 + "valid": false 193 160 }, 194 161 { 195 162 "description": "slash valid", 196 163 "data": { 197 164 "slash": 123 198 165 }, 199 - "valid": true, 200 - "skip": { 201 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {slash:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {slash:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {slash:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {slash:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {slash:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nslash: undefined field: \"slash~1field\":\n generated.cue:4:14\n" 202 - } 166 + "valid": true 203 167 }, 204 168 { 205 169 "description": "tilde valid", 206 170 "data": { 207 171 "tilde": 123 208 172 }, 209 - "valid": true, 210 - "skip": { 211 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {tilde:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {tilde:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {tilde:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {tilde:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {tilde:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\ntilde: undefined field: \"tilde~0field\":\n generated.cue:3:14\n" 212 - } 173 + "valid": true 213 174 }, 214 175 { 215 176 "description": "percent valid", 216 177 "data": { 217 178 "percent": 123 218 179 }, 219 - "valid": true, 220 - "skip": { 221 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {percent:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {percent:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {percent:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {percent:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {percent:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\npercent: undefined field: \"percent%25field\":\n generated.cue:5:14\n" 222 - } 180 + "valid": true 223 181 } 224 182 ] 225 183 }, ··· 322 280 } 323 281 ] 324 282 }, 325 - "skip": { 326 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n", 327 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n" 328 - }, 329 283 "tests": [ 330 284 { 331 285 "description": "$ref resolves to /definitions/base_foo, data does not validate", 332 286 "data": "a", 333 - "valid": false, 334 - "skip": { 335 - "v2": "could not compile schema", 336 - "v3": "could not compile schema" 337 - } 287 + "valid": false 338 288 }, 339 289 { 340 290 "description": "$ref resolves to /definitions/base_foo, data validates", 341 291 "data": 1, 342 - "valid": true, 343 - "skip": { 344 - "v2": "could not compile schema", 345 - "v3": "could not compile schema" 346 - } 292 + "valid": true 347 293 } 348 294 ] 349 295 }, ··· 478 424 } 479 425 } 480 426 }, 481 - "skip": { 482 - "v2": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n", 483 - "v3": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n" 484 - }, 485 427 "tests": [ 486 428 { 487 429 "description": "valid tree", ··· 518 460 } 519 461 ] 520 462 }, 521 - "valid": true, 522 - "skip": { 523 - "v2": "could not compile schema", 524 - "v3": "could not compile schema" 525 - } 463 + "valid": true 526 464 }, 527 465 { 528 466 "description": "invalid tree", ··· 559 497 } 560 498 ] 561 499 }, 562 - "valid": false, 563 - "skip": { 564 - "v2": "could not compile schema", 565 - "v3": "could not compile schema" 566 - } 500 + "valid": false 567 501 } 568 502 ] 569 503 }, ··· 587 521 "data": { 588 522 "foo\"bar": 1 589 523 }, 590 - "valid": true, 591 - "skip": { 592 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {\"foo\\\"bar\":1} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {\"foo\\\"bar\":1} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {\"foo\\\"bar\":1} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {\"foo\\\"bar\":1} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {\"foo\\\"bar\":1} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\n\"foo\\\"bar\": undefined field: \"foo%22bar\":\n generated.cue:3:17\n" 593 - } 524 + "valid": true 594 525 }, 595 526 { 596 527 "description": "object with strings is invalid", 597 528 "data": { 598 529 "foo\"bar": "1" 599 530 }, 600 - "valid": false, 601 - "skip": { 602 - "v3": "unexpected success" 603 - } 531 + "valid": false 604 532 } 605 533 ] 606 534 }, ··· 620 548 } 621 549 }, 622 550 "skip": { 623 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 624 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 551 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 552 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 625 553 }, 626 554 "tests": [ 627 555 { ··· 666 594 } 667 595 }, 668 596 "skip": { 669 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 670 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 597 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 598 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 671 599 }, 672 600 "tests": [ 673 601 { ··· 742 670 } 743 671 ] 744 672 }, 745 - "skip": { 746 - "v2": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n", 747 - "v3": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n" 748 - }, 749 673 "tests": [ 750 674 { 751 675 "description": "number is valid", 752 676 "data": 1, 753 - "valid": true, 754 - "skip": { 755 - "v2": "could not compile schema", 756 - "v3": "could not compile schema" 757 - } 677 + "valid": true 758 678 }, 759 679 { 760 680 "description": "non-number is invalid", 761 681 "data": "a", 762 - "valid": false, 763 - "skip": { 764 - "v2": "could not compile schema", 765 - "v3": "could not compile schema" 766 - } 682 + "valid": false 767 683 } 768 684 ] 769 685 }, ··· 841 757 } 842 758 ] 843 759 }, 844 - "skip": { 845 - "v2": "extract error: cannot refer to definitions section: must refer to one of its elements", 846 - "v3": "extract error: cannot refer to definitions section: must refer to one of its elements" 847 - }, 848 760 "tests": [ 849 761 { 850 762 "description": "number is valid", 851 763 "data": 1, 852 - "valid": true, 853 - "skip": { 854 - "v2": "could not compile schema", 855 - "v3": "could not compile schema" 856 - } 764 + "valid": true 857 765 }, 858 766 { 859 767 "description": "non-number is invalid", 860 768 "data": "a", 861 - "valid": false, 862 - "skip": { 863 - "v2": "could not compile schema", 864 - "v3": "could not compile schema" 865 - } 769 + "valid": false 866 770 } 867 771 ] 868 772 }
+1 -1
encoding/jsonschema/testdata/external/tests/draft6/items.json
··· 402 402 "valid": true, 403 403 "skip": { 404 404 "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", 405 - "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:4:8\n" 405 + "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:9:8\n" 406 406 } 407 407 } 408 408 ]
+3 -19
encoding/jsonschema/testdata/external/tests/draft6/optional/id.json
··· 32 32 } 33 33 ] 34 34 }, 35 - "skip": { 36 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 37 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 38 - }, 39 35 "tests": [ 40 36 { 41 37 "description": "exact match to enum, and type matches", ··· 43 39 "$id": "https://localhost:1234/id/my_identifier.json", 44 40 "type": "null" 45 41 }, 46 - "valid": true, 47 - "skip": { 48 - "v2": "could not compile schema", 49 - "v3": "could not compile schema" 50 - } 42 + "valid": true 51 43 }, 52 44 { 53 45 "description": "match $ref to id", 54 46 "data": "a string to match #/definitions/id_in_enum", 55 - "valid": true, 56 - "skip": { 57 - "v2": "could not compile schema", 58 - "v3": "could not compile schema" 59 - } 47 + "valid": true 60 48 }, 61 49 { 62 50 "description": "no match on enum or $ref to id", 63 51 "data": 1, 64 - "valid": false, 65 - "skip": { 66 - "v2": "could not compile schema", 67 - "v3": "could not compile schema" 68 - } 52 + "valid": false 69 53 } 70 54 ] 71 55 },
+3 -19
encoding/jsonschema/testdata/external/tests/draft6/optional/unknownKeyword.json
··· 41 41 } 42 42 ] 43 43 }, 44 - "skip": { 45 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 46 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 47 - }, 48 44 "tests": [ 49 45 { 50 46 "description": "type matches second anyOf, which has a real schema in it", 51 47 "data": "a string", 52 - "valid": true, 53 - "skip": { 54 - "v2": "could not compile schema", 55 - "v3": "could not compile schema" 56 - } 48 + "valid": true 57 49 }, 58 50 { 59 51 "description": "type matches non-schema in first anyOf", 60 52 "data": null, 61 - "valid": false, 62 - "skip": { 63 - "v2": "could not compile schema", 64 - "v3": "could not compile schema" 65 - } 53 + "valid": false 66 54 }, 67 55 { 68 56 "description": "type matches non-schema in third anyOf", 69 57 "data": 1, 70 - "valid": false, 71 - "skip": { 72 - "v2": "could not compile schema", 73 - "v3": "could not compile schema" 74 - } 58 + "valid": false 75 59 } 76 60 ] 77 61 }
+34 -162
encoding/jsonschema/testdata/external/tests/draft6/ref.json
··· 62 62 } 63 63 } 64 64 }, 65 - "skip": { 66 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 67 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 68 - }, 69 65 "tests": [ 70 66 { 71 67 "description": "match", 72 68 "data": { 73 69 "bar": 3 74 70 }, 75 - "valid": true, 76 - "skip": { 77 - "v2": "could not compile schema", 78 - "v3": "could not compile schema" 79 - } 71 + "valid": true 80 72 }, 81 73 { 82 74 "description": "mismatch", 83 75 "data": { 84 76 "bar": true 85 77 }, 86 - "valid": false, 87 - "skip": { 88 - "v2": "could not compile schema", 89 - "v3": "could not compile schema" 90 - } 78 + "valid": false 91 79 } 92 80 ] 93 81 }, ··· 103 91 } 104 92 ] 105 93 }, 106 - "skip": { 107 - "v2": "extract error: referring to field \"items\" not yet supported", 108 - "v3": "extract error: referring to field \"items\" not yet supported" 109 - }, 110 94 "tests": [ 111 95 { 112 96 "description": "match array", ··· 114 98 1, 115 99 2 116 100 ], 117 - "valid": true, 118 - "skip": { 119 - "v2": "could not compile schema", 120 - "v3": "could not compile schema" 121 - } 101 + "valid": true 122 102 }, 123 103 { 124 104 "description": "mismatch array", ··· 126 106 1, 127 107 "foo" 128 108 ], 129 - "valid": false, 130 - "skip": { 131 - "v2": "could not compile schema", 132 - "v3": "could not compile schema" 133 - } 109 + "valid": false 134 110 } 135 111 ] 136 112 }, ··· 166 142 "data": { 167 143 "slash": "aoeu" 168 144 }, 169 - "valid": false, 170 - "skip": { 171 - "v3": "unexpected success" 172 - } 145 + "valid": false 173 146 }, 174 147 { 175 148 "description": "tilde invalid", 176 149 "data": { 177 150 "tilde": "aoeu" 178 151 }, 179 - "valid": false, 180 - "skip": { 181 - "v3": "unexpected success" 182 - } 152 + "valid": false 183 153 }, 184 154 { 185 155 "description": "percent invalid", 186 156 "data": { 187 157 "percent": "aoeu" 188 158 }, 189 - "valid": false, 190 - "skip": { 191 - "v3": "unexpected success" 192 - } 159 + "valid": false 193 160 }, 194 161 { 195 162 "description": "slash valid", 196 163 "data": { 197 164 "slash": 123 198 165 }, 199 - "valid": true, 200 - "skip": { 201 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {slash:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {slash:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {slash:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {slash:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {slash:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nslash: undefined field: \"slash~1field\":\n generated.cue:4:14\n" 202 - } 166 + "valid": true 203 167 }, 204 168 { 205 169 "description": "tilde valid", 206 170 "data": { 207 171 "tilde": 123 208 172 }, 209 - "valid": true, 210 - "skip": { 211 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {tilde:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {tilde:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {tilde:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {tilde:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {tilde:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\ntilde: undefined field: \"tilde~0field\":\n generated.cue:3:14\n" 212 - } 173 + "valid": true 213 174 }, 214 175 { 215 176 "description": "percent valid", 216 177 "data": { 217 178 "percent": 123 218 179 }, 219 - "valid": true, 220 - "skip": { 221 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {percent:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {percent:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {percent:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {percent:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {percent:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\npercent: undefined field: \"percent%25field\":\n generated.cue:5:14\n" 222 - } 180 + "valid": true 223 181 } 224 182 ] 225 183 }, ··· 322 280 } 323 281 ] 324 282 }, 325 - "skip": { 326 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n", 327 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n" 328 - }, 329 283 "tests": [ 330 284 { 331 285 "description": "$ref resolves to /definitions/base_foo, data does not validate", 332 286 "data": "a", 333 - "valid": false, 334 - "skip": { 335 - "v2": "could not compile schema", 336 - "v3": "could not compile schema" 337 - } 287 + "valid": false 338 288 }, 339 289 { 340 290 "description": "$ref resolves to /definitions/base_foo, data validates", 341 291 "data": 1, 342 - "valid": true, 343 - "skip": { 344 - "v2": "could not compile schema", 345 - "v3": "could not compile schema" 346 - } 292 + "valid": true 347 293 } 348 294 ] 349 295 }, ··· 526 472 } 527 473 } 528 474 }, 529 - "skip": { 530 - "v2": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n", 531 - "v3": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n" 532 - }, 533 475 "tests": [ 534 476 { 535 477 "description": "valid tree", ··· 566 508 } 567 509 ] 568 510 }, 569 - "valid": true, 570 - "skip": { 571 - "v2": "could not compile schema", 572 - "v3": "could not compile schema" 573 - } 511 + "valid": true 574 512 }, 575 513 { 576 514 "description": "invalid tree", ··· 607 545 } 608 546 ] 609 547 }, 610 - "valid": false, 611 - "skip": { 612 - "v2": "could not compile schema", 613 - "v3": "could not compile schema" 614 - } 548 + "valid": false 615 549 } 616 550 ] 617 551 }, ··· 635 569 "data": { 636 570 "foo\"bar": 1 637 571 }, 638 - "valid": true, 639 - "skip": { 640 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {\"foo\\\"bar\":1} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {\"foo\\\"bar\":1} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {\"foo\\\"bar\":1} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {\"foo\\\"bar\":1} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {\"foo\\\"bar\":1} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\n\"foo\\\"bar\": undefined field: \"foo%22bar\":\n generated.cue:3:17\n" 641 - } 572 + "valid": true 642 573 }, 643 574 { 644 575 "description": "object with strings is invalid", 645 576 "data": { 646 577 "foo\"bar": "1" 647 578 }, 648 - "valid": false, 649 - "skip": { 650 - "v3": "unexpected success" 651 - } 579 + "valid": false 652 580 } 653 581 ] 654 582 }, ··· 668 596 } 669 597 }, 670 598 "skip": { 671 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 672 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 599 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 600 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 673 601 }, 674 602 "tests": [ 675 603 { ··· 709 637 } 710 638 }, 711 639 "skip": { 712 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 713 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 640 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 641 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 714 642 }, 715 643 "tests": [ 716 644 { ··· 755 683 } 756 684 }, 757 685 "skip": { 758 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 759 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 686 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 687 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 760 688 }, 761 689 "tests": [ 762 690 { ··· 844 772 } 845 773 ] 846 774 }, 847 - "skip": { 848 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 849 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 850 - }, 851 775 "tests": [ 852 776 { 853 777 "description": "invalid on inner field", ··· 857 781 }, 858 782 "bar": "a" 859 783 }, 860 - "valid": false, 861 - "skip": { 862 - "v2": "could not compile schema", 863 - "v3": "could not compile schema" 864 - } 784 + "valid": false 865 785 }, 866 786 { 867 787 "description": "invalid on outer field", ··· 871 791 }, 872 792 "bar": 1 873 793 }, 874 - "valid": false, 875 - "skip": { 876 - "v2": "could not compile schema", 877 - "v3": "could not compile schema" 878 - } 794 + "valid": false 879 795 }, 880 796 { 881 797 "description": "valid on both fields", ··· 885 801 }, 886 802 "bar": "a" 887 803 }, 888 - "valid": true, 889 - "skip": { 890 - "v2": "could not compile schema", 891 - "v3": "could not compile schema" 892 - } 804 + "valid": true 893 805 } 894 806 ] 895 807 }, ··· 922 834 } 923 835 ] 924 836 }, 925 - "skip": { 926 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 927 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 928 - }, 929 837 "tests": [ 930 838 { 931 839 "description": "invalid on inner field", ··· 935 843 }, 936 844 "bar": "a" 937 845 }, 938 - "valid": false, 939 - "skip": { 940 - "v2": "could not compile schema", 941 - "v3": "could not compile schema" 942 - } 846 + "valid": false 943 847 }, 944 848 { 945 849 "description": "invalid on outer field", ··· 949 853 }, 950 854 "bar": 1 951 855 }, 952 - "valid": false, 953 - "skip": { 954 - "v2": "could not compile schema", 955 - "v3": "could not compile schema" 956 - } 856 + "valid": false 957 857 }, 958 858 { 959 859 "description": "valid on both fields", ··· 963 863 }, 964 864 "bar": "a" 965 865 }, 966 - "valid": true, 967 - "skip": { 968 - "v2": "could not compile schema", 969 - "v3": "could not compile schema" 970 - } 866 + "valid": true 971 867 } 972 868 ] 973 869 }, ··· 1181 1077 } 1182 1078 }, 1183 1079 "skip": { 1184 - "v2": "extract error: anchors (something) not supported (and 1 more errors)", 1185 - "v3": "extract error: anchors (something) not supported (and 1 more errors)" 1080 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 3 more errors)", 1081 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 3 more errors)" 1186 1082 }, 1187 1083 "tests": [ 1188 1084 { ··· 1229 1125 } 1230 1126 ] 1231 1127 }, 1232 - "skip": { 1233 - "v2": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n", 1234 - "v3": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n" 1235 - }, 1236 1128 "tests": [ 1237 1129 { 1238 1130 "description": "a string is valid", 1239 1131 "data": "foo", 1240 - "valid": true, 1241 - "skip": { 1242 - "v2": "could not compile schema", 1243 - "v3": "could not compile schema" 1244 - } 1132 + "valid": true 1245 1133 }, 1246 1134 { 1247 1135 "description": "an integer is invalid", 1248 1136 "data": 12, 1249 - "valid": false, 1250 - "skip": { 1251 - "v2": "could not compile schema", 1252 - "v3": "could not compile schema" 1253 - } 1137 + "valid": false 1254 1138 } 1255 1139 ] 1256 1140 }, ··· 1328 1212 } 1329 1213 ] 1330 1214 }, 1331 - "skip": { 1332 - "v2": "extract error: cannot refer to definitions section: must refer to one of its elements", 1333 - "v3": "extract error: cannot refer to definitions section: must refer to one of its elements" 1334 - }, 1335 1215 "tests": [ 1336 1216 { 1337 1217 "description": "number is valid", 1338 1218 "data": 1, 1339 - "valid": true, 1340 - "skip": { 1341 - "v2": "could not compile schema", 1342 - "v3": "could not compile schema" 1343 - } 1219 + "valid": true 1344 1220 }, 1345 1221 { 1346 1222 "description": "non-number is invalid", 1347 1223 "data": "a", 1348 - "valid": false, 1349 - "skip": { 1350 - "v2": "could not compile schema", 1351 - "v3": "could not compile schema" 1352 - } 1224 + "valid": false 1353 1225 } 1354 1226 ] 1355 1227 }
+1 -1
encoding/jsonschema/testdata/external/tests/draft7/items.json
··· 402 402 "valid": true, 403 403 "skip": { 404 404 "v2": "incompatible list lengths (2 and 3)\n0: incompatible list lengths (1 and 2)\n1: incompatible list lengths (1 and 2)\n", 405 - "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:4:8\n" 405 + "v3": "incompatible list lengths (2 and 3):\n generated.cue:2:1\n0: incompatible list lengths (1 and 2):\n generated.cue:9:8\n" 406 406 } 407 407 } 408 408 ]
+3 -19
encoding/jsonschema/testdata/external/tests/draft7/optional/id.json
··· 32 32 } 33 33 ] 34 34 }, 35 - "skip": { 36 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 37 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/id/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 38 - }, 39 35 "tests": [ 40 36 { 41 37 "description": "exact match to enum, and type matches", ··· 43 39 "$id": "https://localhost:1234/id/my_identifier.json", 44 40 "type": "null" 45 41 }, 46 - "valid": true, 47 - "skip": { 48 - "v2": "could not compile schema", 49 - "v3": "could not compile schema" 50 - } 42 + "valid": true 51 43 }, 52 44 { 53 45 "description": "match $ref to id", 54 46 "data": "a string to match #/definitions/id_in_enum", 55 - "valid": true, 56 - "skip": { 57 - "v2": "could not compile schema", 58 - "v3": "could not compile schema" 59 - } 47 + "valid": true 60 48 }, 61 49 { 62 50 "description": "no match on enum or $ref to id", 63 51 "data": 1, 64 - "valid": false, 65 - "skip": { 66 - "v2": "could not compile schema", 67 - "v3": "could not compile schema" 68 - } 52 + "valid": false 69 53 } 70 54 ] 71 55 },
+3 -19
encoding/jsonschema/testdata/external/tests/draft7/optional/unknownKeyword.json
··· 41 41 } 42 42 ] 43 43 }, 44 - "skip": { 45 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n", 46 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/unknownKeyword/my_identifier.json:my_identifier\":\n generated.cue:1:8\n" 47 - }, 48 44 "tests": [ 49 45 { 50 46 "description": "type matches second anyOf, which has a real schema in it", 51 47 "data": "a string", 52 - "valid": true, 53 - "skip": { 54 - "v2": "could not compile schema", 55 - "v3": "could not compile schema" 56 - } 48 + "valid": true 57 49 }, 58 50 { 59 51 "description": "type matches non-schema in first anyOf", 60 52 "data": null, 61 - "valid": false, 62 - "skip": { 63 - "v2": "could not compile schema", 64 - "v3": "could not compile schema" 65 - } 53 + "valid": false 66 54 }, 67 55 { 68 56 "description": "type matches non-schema in third anyOf", 69 57 "data": 1, 70 - "valid": false, 71 - "skip": { 72 - "v2": "could not compile schema", 73 - "v3": "could not compile schema" 74 - } 58 + "valid": false 75 59 } 76 60 ] 77 61 }
+36 -176
encoding/jsonschema/testdata/external/tests/draft7/ref.json
··· 62 62 } 63 63 } 64 64 }, 65 - "skip": { 66 - "v2": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n", 67 - "v3": "extract error: cannot compile resulting schema: bar: reference \"foo\" not found:\n generated.cue:4:10\n" 68 - }, 69 65 "tests": [ 70 66 { 71 67 "description": "match", 72 68 "data": { 73 69 "bar": 3 74 70 }, 75 - "valid": true, 76 - "skip": { 77 - "v2": "could not compile schema", 78 - "v3": "could not compile schema" 79 - } 71 + "valid": true 80 72 }, 81 73 { 82 74 "description": "mismatch", 83 75 "data": { 84 76 "bar": true 85 77 }, 86 - "valid": false, 87 - "skip": { 88 - "v2": "could not compile schema", 89 - "v3": "could not compile schema" 90 - } 78 + "valid": false 91 79 } 92 80 ] 93 81 }, ··· 103 91 } 104 92 ] 105 93 }, 106 - "skip": { 107 - "v2": "extract error: referring to field \"items\" not yet supported", 108 - "v3": "extract error: referring to field \"items\" not yet supported" 109 - }, 110 94 "tests": [ 111 95 { 112 96 "description": "match array", ··· 114 98 1, 115 99 2 116 100 ], 117 - "valid": true, 118 - "skip": { 119 - "v2": "could not compile schema", 120 - "v3": "could not compile schema" 121 - } 101 + "valid": true 122 102 }, 123 103 { 124 104 "description": "mismatch array", ··· 126 106 1, 127 107 "foo" 128 108 ], 129 - "valid": false, 130 - "skip": { 131 - "v2": "could not compile schema", 132 - "v3": "could not compile schema" 133 - } 109 + "valid": false 134 110 } 135 111 ] 136 112 }, ··· 166 142 "data": { 167 143 "slash": "aoeu" 168 144 }, 169 - "valid": false, 170 - "skip": { 171 - "v3": "unexpected success" 172 - } 145 + "valid": false 173 146 }, 174 147 { 175 148 "description": "tilde invalid", 176 149 "data": { 177 150 "tilde": "aoeu" 178 151 }, 179 - "valid": false, 180 - "skip": { 181 - "v3": "unexpected success" 182 - } 152 + "valid": false 183 153 }, 184 154 { 185 155 "description": "percent invalid", 186 156 "data": { 187 157 "percent": "aoeu" 188 158 }, 189 - "valid": false, 190 - "skip": { 191 - "v3": "unexpected success" 192 - } 159 + "valid": false 193 160 }, 194 161 { 195 162 "description": "slash valid", 196 163 "data": { 197 164 "slash": 123 198 165 }, 199 - "valid": true, 200 - "skip": { 201 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {slash:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {slash:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {slash:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {slash:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {slash:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\nslash: undefined field: \"slash~1field\":\n generated.cue:4:14\n" 202 - } 166 + "valid": true 203 167 }, 204 168 { 205 169 "description": "tilde valid", 206 170 "data": { 207 171 "tilde": 123 208 172 }, 209 - "valid": true, 210 - "skip": { 211 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {tilde:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {tilde:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {tilde:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {tilde:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {tilde:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\ntilde: undefined field: \"tilde~0field\":\n generated.cue:3:14\n" 212 - } 173 + "valid": true 213 174 }, 214 175 { 215 176 "description": "percent valid", 216 177 "data": { 217 178 "percent": 123 218 179 }, 219 - "valid": true, 220 - "skip": { 221 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {percent:123} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {percent:123} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {percent:123} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {percent:123} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {percent:123} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\npercent: undefined field: \"percent%25field\":\n generated.cue:5:14\n" 222 - } 180 + "valid": true 223 181 } 224 182 ] 225 183 }, ··· 322 280 } 323 281 ] 324 282 }, 325 - "skip": { 326 - "v2": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n", 327 - "v3": "extract error: cannot compile resulting schema: invalid import path: \"localhost:1234/sibling_id/base/foo.json:foo\":\n generated.cue:1:8\n" 328 - }, 329 283 "tests": [ 330 284 { 331 285 "description": "$ref resolves to /definitions/base_foo, data does not validate", 332 286 "data": "a", 333 - "valid": false, 334 - "skip": { 335 - "v2": "could not compile schema", 336 - "v3": "could not compile schema" 337 - } 287 + "valid": false 338 288 }, 339 289 { 340 290 "description": "$ref resolves to /definitions/base_foo, data validates", 341 291 "data": 1, 342 - "valid": true, 343 - "skip": { 344 - "v2": "could not compile schema", 345 - "v3": "could not compile schema" 346 - } 292 + "valid": true 347 293 } 348 294 ] 349 295 }, ··· 526 472 } 527 473 } 528 474 }, 529 - "skip": { 530 - "v2": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n", 531 - "v3": "extract error: cannot compile resulting schema: builtin package \"localhost:1234/node\" undefined:\n generated.cue:1:8\n_schema.nodes: reference \"node\" not found:\n generated.cue:8:14\n" 532 - }, 533 475 "tests": [ 534 476 { 535 477 "description": "valid tree", ··· 566 508 } 567 509 ] 568 510 }, 569 - "valid": true, 570 - "skip": { 571 - "v2": "could not compile schema", 572 - "v3": "could not compile schema" 573 - } 511 + "valid": true 574 512 }, 575 513 { 576 514 "description": "invalid tree", ··· 607 545 } 608 546 ] 609 547 }, 610 - "valid": false, 611 - "skip": { 612 - "v2": "could not compile schema", 613 - "v3": "could not compile schema" 614 - } 548 + "valid": false 615 549 } 616 550 ] 617 551 }, ··· 635 569 "data": { 636 570 "foo\"bar": 1 637 571 }, 638 - "valid": true, 639 - "skip": { 640 - "v2": "6 errors in empty disjunction:\nconflicting values [...] and {\"foo\\\"bar\":1} (mismatched types list and struct):\n generated.cue:2:33\n instance.json:1:1\nconflicting values bool and {\"foo\\\"bar\":1} (mismatched types bool and struct):\n generated.cue:2:8\n instance.json:1:1\nconflicting values null and {\"foo\\\"bar\":1} (mismatched types null and struct):\n generated.cue:2:1\n instance.json:1:1\nconflicting values number and {\"foo\\\"bar\":1} (mismatched types number and struct):\n generated.cue:2:15\n instance.json:1:1\nconflicting values string and {\"foo\\\"bar\":1} (mismatched types string and struct):\n generated.cue:2:24\n instance.json:1:1\n\"foo\\\"bar\": undefined field: \"foo%22bar\":\n generated.cue:3:17\n" 641 - } 572 + "valid": true 642 573 }, 643 574 { 644 575 "description": "object with strings is invalid", 645 576 "data": { 646 577 "foo\"bar": "1" 647 578 }, 648 - "valid": false, 649 - "skip": { 650 - "v3": "unexpected success" 651 - } 579 + "valid": false 652 580 } 653 581 ] 654 582 }, ··· 668 596 } 669 597 }, 670 598 "skip": { 671 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 672 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 599 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 600 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 673 601 }, 674 602 "tests": [ 675 603 { ··· 709 637 } 710 638 }, 711 639 "skip": { 712 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 713 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 640 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 641 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 714 642 }, 715 643 "tests": [ 716 644 { ··· 755 683 } 756 684 }, 757 685 "skip": { 758 - "v2": "extract error: $id URI may not contain a fragment (and 1 more errors)", 759 - "v3": "extract error: $id URI may not contain a fragment (and 1 more errors)" 686 + "v2": "extract error: $id URI may not contain a fragment (and 3 more errors)", 687 + "v3": "extract error: $id URI may not contain a fragment (and 3 more errors)" 760 688 }, 761 689 "tests": [ 762 690 { ··· 843 771 "$ref": "schema-relative-uri-defs2.json" 844 772 } 845 773 ] 846 - }, 847 - "skip": { 848 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 849 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-relative-uri-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 850 774 }, 851 775 "tests": [ 852 776 { ··· 857 781 }, 858 782 "bar": "a" 859 783 }, 860 - "valid": false, 861 - "skip": { 862 - "v2": "could not compile schema", 863 - "v3": "could not compile schema" 864 - } 784 + "valid": false 865 785 }, 866 786 { 867 787 "description": "invalid on outer field", ··· 871 791 }, 872 792 "bar": 1 873 793 }, 874 - "valid": false, 875 - "skip": { 876 - "v2": "could not compile schema", 877 - "v3": "could not compile schema" 878 - } 794 + "valid": false 879 795 }, 880 796 { 881 797 "description": "valid on both fields", ··· 885 801 }, 886 802 "bar": "a" 887 803 }, 888 - "valid": true, 889 - "skip": { 890 - "v2": "could not compile schema", 891 - "v3": "could not compile schema" 892 - } 804 + "valid": true 893 805 } 894 806 ] 895 807 }, ··· 922 834 } 923 835 ] 924 836 }, 925 - "skip": { 926 - "v2": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n", 927 - "v3": "extract error: cannot compile resulting schema: package \"example.com/schema-refs-absolute-uris-defs2.json:schema\" imported but not defined in :\n generated.cue:1:8\n" 928 - }, 929 837 "tests": [ 930 838 { 931 839 "description": "invalid on inner field", ··· 935 843 }, 936 844 "bar": "a" 937 845 }, 938 - "valid": false, 939 - "skip": { 940 - "v2": "could not compile schema", 941 - "v3": "could not compile schema" 942 - } 846 + "valid": false 943 847 }, 944 848 { 945 849 "description": "invalid on outer field", ··· 949 853 }, 950 854 "bar": 1 951 855 }, 952 - "valid": false, 953 - "skip": { 954 - "v2": "could not compile schema", 955 - "v3": "could not compile schema" 956 - } 856 + "valid": false 957 857 }, 958 858 { 959 859 "description": "valid on both fields", ··· 963 863 }, 964 864 "bar": "a" 965 865 }, 966 - "valid": true, 967 - "skip": { 968 - "v2": "could not compile schema", 969 - "v3": "could not compile schema" 970 - } 866 + "valid": true 971 867 } 972 868 ] 973 869 }, ··· 994 890 } 995 891 ] 996 892 }, 997 - "skip": { 998 - "v2": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n", 999 - "v3": "extract error: cannot compile resulting schema: package \"example.com/b/d.json:d\" imported but not defined in :\n generated.cue:1:8\n" 1000 - }, 1001 893 "tests": [ 1002 894 { 1003 895 "description": "number is valid", 1004 896 "data": 1, 1005 - "valid": true, 1006 - "skip": { 1007 - "v2": "could not compile schema", 1008 - "v3": "could not compile schema" 1009 - } 897 + "valid": true 1010 898 }, 1011 899 { 1012 900 "description": "non-number is invalid", 1013 901 "data": "a", 1014 - "valid": false, 1015 - "skip": { 1016 - "v2": "could not compile schema", 1017 - "v3": "could not compile schema" 1018 - } 902 + "valid": false 1019 903 } 1020 904 ] 1021 905 }, ··· 1229 1113 } 1230 1114 }, 1231 1115 "skip": { 1232 - "v2": "extract error: anchors (something) not supported (and 1 more errors)", 1233 - "v3": "extract error: anchors (something) not supported (and 1 more errors)" 1116 + "v2": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 3 more errors)", 1117 + "v3": "extract error: cannot determine CUE location for JSON Schema location id=urn:uuid:deadbeef-1234-ff00-00ff-4321feebdaed#something: anchors (something) not supported (and 3 more errors)" 1234 1118 }, 1235 1119 "tests": [ 1236 1120 { ··· 1397 1281 } 1398 1282 ] 1399 1283 }, 1400 - "skip": { 1401 - "v2": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n", 1402 - "v3": "extract error: cannot compile resulting schema: package \"example.com/absref/foobar.json:foobar\" imported but not defined in :\n generated.cue:1:8\n" 1403 - }, 1404 1284 "tests": [ 1405 1285 { 1406 1286 "description": "a string is valid", 1407 1287 "data": "foo", 1408 - "valid": true, 1409 - "skip": { 1410 - "v2": "could not compile schema", 1411 - "v3": "could not compile schema" 1412 - } 1288 + "valid": true 1413 1289 }, 1414 1290 { 1415 1291 "description": "an integer is invalid", 1416 1292 "data": 12, 1417 - "valid": false, 1418 - "skip": { 1419 - "v2": "could not compile schema", 1420 - "v3": "could not compile schema" 1421 - } 1293 + "valid": false 1422 1294 } 1423 1295 ] 1424 1296 }, ··· 1496 1368 } 1497 1369 ] 1498 1370 }, 1499 - "skip": { 1500 - "v2": "extract error: cannot refer to definitions section: must refer to one of its elements", 1501 - "v3": "extract error: cannot refer to definitions section: must refer to one of its elements" 1502 - }, 1503 1371 "tests": [ 1504 1372 { 1505 1373 "description": "number is valid", 1506 1374 "data": 1, 1507 - "valid": true, 1508 - "skip": { 1509 - "v2": "could not compile schema", 1510 - "v3": "could not compile schema" 1511 - } 1375 + "valid": true 1512 1376 }, 1513 1377 { 1514 1378 "description": "non-number is invalid", 1515 1379 "data": "a", 1516 - "valid": false, 1517 - "skip": { 1518 - "v2": "could not compile schema", 1519 - "v3": "could not compile schema" 1520 - } 1380 + "valid": false 1521 1381 } 1522 1382 ] 1523 1383 }
+7 -6
encoding/jsonschema/testdata/txtar/basic.txtar
··· 51 51 } 52 52 } 53 53 -- out/decode/extract -- 54 - import "strings" 55 - 56 54 // Main schema 57 55 // 58 56 // Specify who you are and all. 57 + 58 + import "strings" 59 + 59 60 @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 60 61 61 62 // A person is a human being. ··· 68 69 // A very large comment that will be wrapped after a certain line 69 70 // length. Let's keep on going and see what happens. 70 71 children?: [...string] 71 - "home phone"?: #["phone%20number"] @deprecated() 72 + "home phone"?: #."phone number" @deprecated() 72 73 ... 73 74 } 74 75 75 - // address stores a postal address 76 - #address: strings.MinRunes(4) & strings.MaxRunes(20) 77 - 78 76 // a telephone number 79 77 #: "phone number": string 78 + 79 + // address stores a postal address 80 + #address: strings.MinRunes(4) & strings.MaxRunes(20) 80 81 ...
+1
encoding/jsonschema/testdata/txtar/contains.txtar
··· 37 37 import "list" 38 38 39 39 @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 40 + 40 41 close({ 41 42 p1?: list.MatchN(>=1, _) 42 43 p2?: list.MatchN(>=0, _)
+7 -7
encoding/jsonschema/testdata/txtar/def.txtar
··· 41 41 -- out/decode/extract -- 42 42 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 43 43 @jsonschema(id="http://cuelang.org/go/encoding/openapi/testdata/order.json") 44 - person?: #["per-son"] 44 + person?: #."per-son" 45 45 billing_address?: #address 46 46 shipping_address?: #address 47 47 48 + #: "per-son": { 49 + name?: string 50 + children?: [...#."per-son"] 51 + ... 52 + } 53 + 48 54 #address: { 49 55 street_address!: string 50 56 city!: string 51 57 state!: string 52 - ... 53 - } 54 - 55 - #: "per-son": { 56 - name?: string 57 - children?: [...#["per-son"]] 58 58 ... 59 59 } 60 60 ...
+1
encoding/jsonschema/testdata/txtar/emptyobj.txtar
··· 24 24 } 25 25 -- out/decode/extract -- 26 26 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 27 + 27 28 _ 28 29 29 30 #obj1: null | {
+7 -3
encoding/jsonschema/testdata/txtar/id_in_oneOf.txtar
··· 17 17 -- out/decode/extract -- 18 18 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 19 19 @jsonschema(id="https://test.example/foo") 20 - matchN(1, [{ 20 + matchN(1, [_#defs."/oneOf/0", _#defs."/oneOf/1"]) 21 + 22 + _#defs: "/oneOf/0": { 21 23 @jsonschema(id="https://1.test.example/string") 22 24 string 23 - }, { 25 + } 26 + 27 + _#defs: "/oneOf/1": { 24 28 @jsonschema(id="https://2.test.example/object") 25 29 ... 26 - }]) 30 + }
+1
encoding/jsonschema/testdata/txtar/ifthenelse.txtar
··· 25 25 } 26 26 -- out/decode/extract -- 27 27 @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 28 + 28 29 matchIf({ 29 30 a!: number 30 31 ...
+56 -24
encoding/jsonschema/testdata/txtar/issue3351.txtar
··· 65 65 "type": "object" 66 66 } 67 67 -- out/decode-v3/extract -- 68 + // JSON-e templates 69 + @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 68 70 _schema 69 71 _schema: { 70 - // JSON-e templates 71 - @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 72 72 close({ 73 73 @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-e@1.json") 74 - $else?: #["jsone-value"] 74 + $else?: #."jsone-value" 75 75 $let?: close({ 76 76 [string]: null | bool | number | string | [...] | close({ 77 77 [string]: _schema 78 78 }) 79 79 }) 80 80 $sort?: matchN(>=1, [_schema, [...number]]) 81 - {[!~"^(\\$else|\\$let|\\$sort)$"]: #["jsone-value"]} 81 + {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 82 82 }) 83 83 84 - #: "jsone-value": matchN(1, [_schema, [..._schema]]) 85 - 86 - #: "jsone-array": [...#["jsone-value"]] 84 + #: "jsone-array": [...#."jsone-value"] 87 85 88 86 #: "jsone-object-array": [..._schema] 87 + 88 + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 89 89 } 90 90 -- diff/-out/decode-v3/extract<==>+out/decode/extract -- 91 91 diff old new 92 92 --- old 93 93 +++ new 94 - @@ -10,11 +10,11 @@ 94 + @@ -1,22 +1,22 @@ 95 + +// JSON-e templates 96 + +@jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 97 + _schema 98 + _schema: { 99 + - // JSON-e templates 100 + - @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 101 + close({ 102 + @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-e@1.json") 103 + - $else?: #["jsone-value"] 104 + + $else?: #."jsone-value" 105 + $let?: close({ 106 + [string]: null | bool | number | string | [...] | close({ 95 107 [string]: _schema 96 108 }) 97 109 }) 98 110 - $sort?: _schema | [...number] 99 111 - {[!~"^($else|$let|$sort)$"]: #["jsone-value"]} 100 112 + $sort?: matchN(>=1, [_schema, [...number]]) 101 - + {[!~"^(\\$else|\\$let|\\$sort)$"]: #["jsone-value"]} 113 + + {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 102 114 }) 103 115 104 116 - #: "jsone-value": _schema | [..._schema] 105 - + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 106 - 107 - #: "jsone-array": [...#["jsone-value"]] 117 + - 118 + - #: "jsone-array": [...#["jsone-value"]] 119 + + #: "jsone-array": [...#."jsone-value"] 108 120 121 + #: "jsone-object-array": [..._schema] 122 + + 123 + + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 124 + } 109 125 -- out/decode-v3-noshare/extract -- 126 + // JSON-e templates 127 + @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 110 128 _schema 111 129 _schema: { 112 - // JSON-e templates 113 - @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 114 130 close({ 115 131 @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-e@1.json") 116 - $else?: #["jsone-value"] 132 + $else?: #."jsone-value" 117 133 $let?: close({ 118 134 [string]: null | bool | number | string | [...] | close({ 119 135 [string]: _schema 120 136 }) 121 137 }) 122 138 $sort?: matchN(>=1, [_schema, [...number]]) 123 - {[!~"^(\\$else|\\$let|\\$sort)$"]: #["jsone-value"]} 139 + {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 124 140 }) 125 141 126 - #: "jsone-value": matchN(1, [_schema, [..._schema]]) 127 - 128 - #: "jsone-array": [...#["jsone-value"]] 142 + #: "jsone-array": [...#."jsone-value"] 129 143 130 144 #: "jsone-object-array": [..._schema] 145 + 146 + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 131 147 } 132 148 -- diff/-out/decode-v3-noshare/extract<==>+out/decode/extract -- 133 149 diff old new 134 150 --- old 135 151 +++ new 136 - @@ -10,11 +10,11 @@ 152 + @@ -1,22 +1,22 @@ 153 + +// JSON-e templates 154 + +@jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 155 + _schema 156 + _schema: { 157 + - // JSON-e templates 158 + - @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 159 + close({ 160 + @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-e@1.json") 161 + - $else?: #["jsone-value"] 162 + + $else?: #."jsone-value" 163 + $let?: close({ 164 + [string]: null | bool | number | string | [...] | close({ 137 165 [string]: _schema 138 166 }) 139 167 }) 140 168 - $sort?: _schema | [...number] 141 169 - {[!~"^($else|$let|$sort)$"]: #["jsone-value"]} 142 170 + $sort?: matchN(>=1, [_schema, [...number]]) 143 - + {[!~"^(\\$else|\\$let|\\$sort)$"]: #["jsone-value"]} 171 + + {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 144 172 }) 145 173 146 174 - #: "jsone-value": _schema | [..._schema] 147 - + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 148 - 149 - #: "jsone-array": [...#["jsone-value"]] 175 + - 176 + - #: "jsone-array": [...#["jsone-value"]] 177 + + #: "jsone-array": [...#."jsone-value"] 150 178 179 + #: "jsone-object-array": [..._schema] 180 + + 181 + + #: "jsone-value": matchN(1, [_schema, [..._schema]]) 182 + } 151 183 -- out/decode/extract -- 152 184 _schema 153 185 _schema: {
+4 -3
encoding/jsonschema/testdata/txtar/list.txtar
··· 45 45 import "list" 46 46 47 47 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 48 + 48 49 close({ 49 50 foo?: [...string] 50 51 tuple?: [string, int, 2, ...] ··· 55 56 }) 56 57 -- out/decode/testerr/err-foo-not-string -- 57 58 foo.0: conflicting values true and string (mismatched types bool and string): 58 - generated.cue:4:1 59 - generated.cue:5:9 60 - generated.cue:5:12 59 + generated.cue:5:1 60 + generated.cue:6:9 61 + generated.cue:6:12 61 62 test/err-foo-not-string.json:2:10 62 63 -- test/empty.json -- 63 64 {}
+2 -1
encoding/jsonschema/testdata/txtar/object.txtar
··· 68 68 } 69 69 70 70 -- out/decode/extract -- 71 + // Main schema 72 + 71 73 import "struct" 72 74 73 - // Main schema 74 75 close({ 75 76 fields?: struct.MaxFields(10) & struct.MinFields(3) & { 76 77 [=~"^\\P{Lu}"]: _
+3 -3
encoding/jsonschema/testdata/txtar/openapi.txtar
··· 19 19 type: string 20 20 21 21 -- out/decode/extract -- 22 + // The number to dial. 23 + #PhoneNumber: string 24 + 22 25 // A User uses something. 23 26 #User: { 24 27 id?: int ··· 27 30 null | #PhoneNumber 28 31 ... 29 32 } 30 - 31 - // The number to dial. 32 - #PhoneNumber: string
+1
encoding/jsonschema/testdata/txtar/openapi_int.txtar
··· 12 12 13 13 -- out/decode/extract -- 14 14 #Int32: int32 15 + 15 16 #Int64: int64
+1
encoding/jsonschema/testdata/txtar/perl_pattern.txtar
··· 8 8 } 9 9 -- out/decode/extract -- 10 10 @jsonschema(schema="https://json-schema.org/draft/2020-12/schema") 11 + 11 12 _
+13 -13
encoding/jsonschema/testdata/txtar/ref.txtar
··· 67 67 import ( 68 68 "acme.com/external.json:external" 69 69 "acme.com/external-foo.json:schema" 70 - schema_5 "acme.com/external-bar.json:schema" 70 + schema_1 "acme.com/external-bar.json:schema" 71 71 ) 72 72 73 73 @jsonschema(schema="http://json-schema.org/draft-07/schema#") ··· 75 75 person?: #person 76 76 billing_address?: #address 77 77 shipping_address?: #address 78 + 79 + #: "string-int": int | string 78 80 79 81 #address: { 80 82 city?: string 81 83 ... 82 84 } 83 85 84 - #int_1=#int: int 85 - 86 - #: "string-int": int | string 86 + #int: int 87 87 88 88 #person: { 89 89 @jsonschema(id="http://cuelang.org/person.json") 90 90 name?: string 91 91 children?: { 92 - x?: external.foo 93 - a?: #int 94 - b?: #int 95 - c?: #int_1 92 + x?: external._#defs."/properties/foo" 93 + a?: _#defs."/$defs/person/$defs/int" 94 + b?: _#defs."/$defs/person/$defs/int" 95 + c?: #int 96 96 d?: #address 97 - e?: #["string-int"] 97 + e?: #."string-int" 98 98 f?: #person 99 99 g?: external.#foo 100 - h?: external.foo 100 + h?: external._#defs."/properties/foo" 101 101 i?: external 102 102 j?: schema 103 - k?: schema_5 103 + k?: schema_1 104 104 z?: _ 105 105 ... 106 106 } 107 - 108 - #int: int 109 107 ... 110 108 } 109 + 110 + _#defs: "/$defs/person/$defs/int": int 111 111 ...
+3 -3
encoding/jsonschema/testdata/txtar/refroot.txtar
··· 13 13 } 14 14 15 15 -- out/decode/extract -- 16 + @jsonschema(schema="http://json-schema.org/draft-07/schema#") 16 17 _schema 17 - _schema: { 18 - @jsonschema(schema="http://json-schema.org/draft-07/schema#") 18 + _schema: 19 + 19 20 null | bool | number | string | [...] | { 20 21 @jsonschema(id="http://cuelang.org/go/encoding/openapi/testdata/order.json") 21 22 value?: _ 22 23 next?: _schema 23 24 ... 24 25 } 25 - }
+3 -3
encoding/jsonschema/testdata/txtar/refroot2.txtar
··· 11 11 } 12 12 13 13 -- out/decode/extract -- 14 + @jsonschema(schema="http://json-schema.org/draft-07/schema#") 14 15 _schema 15 - _schema: { 16 - @jsonschema(schema="http://json-schema.org/draft-07/schema#") 16 + _schema: 17 + 17 18 null | bool | number | string | [...] | { 18 19 value?: _ 19 20 next?: _schema 20 21 ... 21 22 } 22 - }
+1
encoding/jsonschema/testdata/txtar/required.txtar
··· 21 21 -- out/decode/extract -- 22 22 // example jsonschema 23 23 @jsonschema(schema="http://json-schema.org/draft-04/schema#") 24 + 24 25 close({ 25 26 @jsonschema(id="https://example.test/example") 26 27
+1
encoding/jsonschema/testdata/txtar/type.txtar
··· 31 31 32 32 -- out/decode/extract -- 33 33 // Main schema 34 + 34 35 close({ 35 36 // an integer or string. 36 37 intString?: null | bool | int | string | [...]
+1
encoding/jsonschema/testdata/txtar/unsupported.txtar
··· 33 33 34 34 -- out/decode/extract -- 35 35 @jsonschema(schema="http://json-schema.org/draft-07/schema#") 36 + 36 37 _ 37 38 38 39 #ref: matchN(1, [matchN(0, [string]) & {
+59
encoding/jsonschema/util.go
··· 17 17 import ( 18 18 "fmt" 19 19 "slices" 20 + "strconv" 20 21 "strings" 21 22 22 23 "cuelang.org/go/cue" ··· 160 161 } 161 162 } 162 163 164 + func cuePathToJSONPointer(p cue.Path) string { 165 + return jsonPointerFromTokens(func(yield func(s string) bool) { 166 + for _, sel := range p.Selectors() { 167 + var token string 168 + switch sel.Type() { 169 + case cue.StringLabel: 170 + token = sel.Unquoted() 171 + case cue.IndexLabel: 172 + token = strconv.Itoa(sel.Index()) 173 + default: 174 + panic(fmt.Errorf("cannot convert selector %v to JSON pointer", sel)) 175 + } 176 + if !yield(token) { 177 + return 178 + } 179 + } 180 + }) 181 + } 182 + 183 + // relPath returns the path to v relative to root, 184 + // which must be a direct ancestor of v. 185 + func relPath(v, root cue.Value) cue.Path { 186 + rootPath := root.Path().Selectors() 187 + vPath := v.Path().Selectors() 188 + if !sliceHasPrefix(vPath, rootPath) { 189 + panic("value is not inside root") 190 + } 191 + return cue.MakePath(vPath[len(rootPath):]...) 192 + } 193 + 194 + func sliceHasPrefix[E comparable](s1, s2 []E) bool { 195 + if len(s2) > len(s1) { 196 + return false 197 + } 198 + return slices.Equal(s1[:len(s2)], s2) 199 + } 200 + 163 201 // TODO remove this when we can use [slices.SortedFunc] and [maps.Keys]. 164 202 func sortedKeys[K comparable, V any](m map[K]V, cmp func(K, K) int) []K { 165 203 ks := make([]K, 0, len(m)) ··· 169 207 slices.SortFunc(ks, cmp) 170 208 return ks 171 209 } 210 + 211 + // TODO(go1.23) use slices.Collect 212 + func collectSlice[E any](seq func(func(E) bool)) []E { 213 + var s []E 214 + seq(func(v E) bool { 215 + s = append(s, v) 216 + return true 217 + }) 218 + return s 219 + } 220 + 221 + // TODO(go1.23) use slices.Values 222 + func sliceValues[Slice ~[]E, E any](s Slice) func(func(E) bool) { 223 + return func(yield func(E) bool) { 224 + for _, v := range s { 225 + if !yield(v) { 226 + return 227 + } 228 + } 229 + } 230 + }
+54
encoding/jsonschema/valuemap.go
··· 1 + package jsonschema 2 + 3 + import ( 4 + "cuelang.org/go/cue" 5 + "cuelang.org/go/cue/token" 6 + ) 7 + 8 + // valueMap holds a map of values indexed by schema position 9 + // (a.k.a. JSON Pointer). 10 + // 11 + // It's designed so that it's cheap in the common case that a lookup 12 + // returns false and that there are many more lookups than 13 + // entries in the map. 14 + // 15 + // It does that by using the source position of the 16 + // schema as a first probe. Determining the source location of a value 17 + // is very cheap, and in most practical cases, JSON Schema is being 18 + // extracted from concrete JSON where there will be a bijective mapping 19 + // between source location and path. 20 + type valueMap[T any] struct { 21 + byPos map[token.Pos]bool 22 + byPath map[string]T 23 + } 24 + 25 + func newValueMap[T any]() *valueMap[T] { 26 + return &valueMap[T]{ 27 + byPos: make(map[token.Pos]bool), 28 + byPath: make(map[string]T), 29 + } 30 + } 31 + 32 + func (m *valueMap[T]) len() int { 33 + return len(m.byPath) 34 + } 35 + 36 + func (m *valueMap[T]) set(key cue.Value, v T) { 37 + m.byPos[key.Pos()] = true 38 + m.byPath[key.Path().String()] = v 39 + } 40 + 41 + func (m *valueMap[T]) get(key cue.Value) T { 42 + if !m.byPos[key.Pos()] { 43 + return *new(T) 44 + } 45 + return m.byPath[key.Path().String()] 46 + } 47 + 48 + func (m *valueMap[T]) lookup(key cue.Value) (T, bool) { 49 + if !m.byPos[key.Pos()] { 50 + return *new(T), false 51 + } 52 + v, ok := m.byPath[key.Path().String()] 53 + return v, ok 54 + }
+3 -3
encoding/openapi/testdata/script/basics.txtar
··· 35 35 url: "https://cuelang.org" 36 36 } 37 37 } 38 + // The number to dial. 39 + #PhoneNumber: string 40 + 38 41 // A User uses something. 39 42 #User: { 40 43 id?: int ··· 42 45 address?: #PhoneNumber 43 46 ... 44 47 } 45 - 46 - // The number to dial. 47 - #PhoneNumber: string