cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/txtar/issue3351.txtar (about) 1 #noverify 2 #brokenInV2 3 -- schema.json -- 4 { 5 "$schema": "https://json-schema.org/draft/2019-09/schema", 6 "$id": "https://www.sourcemeta.com/schemas/vendor/json-eXXXX@1.json", 7 "$comment": "https://json-e.js.org", 8 "$defs": { 9 "jsone-value": { 10 "oneOf": [ 11 { 12 "$ref": "#" 13 }, 14 { 15 "type": "array", 16 "items": { 17 "$ref": "#" 18 } 19 } 20 ] 21 }, 22 "jsone-array": { 23 "type": "array", 24 "items": { 25 "$ref": "#/$defs/jsone-value" 26 } 27 }, 28 "jsone-object-array": { 29 "type": "array", 30 "items": { 31 "$ref": "#" 32 } 33 } 34 }, 35 "additionalProperties": { 36 "$ref": "#/$defs/jsone-value" 37 }, 38 "properties": { 39 "$else": { 40 "$ref": "#/$defs/jsone-value" 41 }, 42 "$let": { 43 "type": "object", 44 "additionalProperties": { 45 "additionalProperties": { 46 "$ref": "#" 47 } 48 } 49 }, 50 "$sort": { 51 "anyOf": [ 52 { 53 "$ref": "#" 54 }, 55 { 56 "type": "array", 57 "items": { 58 "type": "number" 59 } 60 } 61 ] 62 } 63 }, 64 "title": "JSON-e templates", 65 "type": "object" 66 } 67 -- out/decode-v3/extract -- 68 // JSON-e templates 69 @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 70 _schema 71 _schema: { 72 @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-eXXXX@1.json") 73 $else?: #."jsone-value" 74 $let?: [string]: null | bool | number | string | [...] | { 75 [string]: _schema 76 } 77 $sort?: matchN(>=1, [_schema, [...number]]) 78 {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 79 80 #: "jsone-array": [...#."jsone-value"] 81 82 #: "jsone-object-array": [..._schema] 83 84 #: "jsone-value": matchN(1, [_schema, [..._schema]]) 85 } 86 -- out/decode-v3-noshare/extract -- 87 // JSON-e templates 88 @jsonschema(schema="https://json-schema.org/draft/2019-09/schema") 89 _schema 90 _schema: { 91 @jsonschema(id="https://www.sourcemeta.com/schemas/vendor/json-eXXXX@1.json") 92 $else?: #."jsone-value" 93 $let?: [string]: null | bool | number | string | [...] | { 94 [string]: _schema 95 } 96 $sort?: matchN(>=1, [_schema, [...number]]) 97 {[!~"^(\\$else|\\$let|\\$sort)$"]: #."jsone-value"} 98 99 #: "jsone-array": [...#."jsone-value"] 100 101 #: "jsone-object-array": [..._schema] 102 103 #: "jsone-value": matchN(1, [_schema, [..._schema]]) 104 }