-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/jsonschema: add test case for issue 3351
This test case works with the current evaluator, but currently panics with CUE_EXPERIMENT=evalv3. For #3351. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I1fc4050296d4269feb60ffab76341a1d75d87551 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198735 Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
-- json-e.json -- | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"$id": "https://www.sourcemeta.com/schemas/vendor/[email protected]", | ||
"$comment": "https://json-e.js.org", | ||
"$defs": { | ||
"jsone-value": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"$ref": "#" | ||
} | ||
} | ||
] | ||
}, | ||
"jsone-array": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/jsone-value" | ||
} | ||
}, | ||
"jsone-object-array": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#" | ||
} | ||
} | ||
}, | ||
"additionalProperties": { | ||
"$ref": "#/$defs/jsone-value" | ||
}, | ||
"properties": { | ||
"$else": { | ||
"$ref": "#/$defs/jsone-value" | ||
}, | ||
"$let": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"additionalProperties": { | ||
"$ref": "#" | ||
} | ||
} | ||
}, | ||
"$sort": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"title": "JSON-e templates", | ||
"type": "object" | ||
} | ||
-- out/decode/cue -- | ||
_schema | ||
_schema: { | ||
// JSON-e templates | ||
@jsonschema(schema="https://json-schema.org/draft/2019-09/schema") | ||
@jsonschema(id="https://www.sourcemeta.com/schemas/vendor/[email protected]") | ||
$else?: #["jsone-value"] | ||
$let?: [string]: null | bool | number | string | [...] | { | ||
[string]: _schema_1 | ||
} | ||
$sort?: (_schema_5 | [...number]) & _ | ||
{[!~"^($else|$let|$sort)$"]: #["jsone-value"]} | ||
|
||
#: "jsone-value": _schema_A | [..._schema_8] | ||
|
||
#: "jsone-array": [...#["jsone-value"]] | ||
|
||
#: "jsone-object-array": [..._schema_E] | ||
} | ||
|
||
let _schema_1 = _schema | ||
|
||
let _schema_5 = _schema | ||
|
||
let _schema_A = _schema | ||
|
||
let _schema_8 = _schema | ||
|
||
let _schema_E = _schema |