From 83835e9c1aa8dde9f60b325f7111caae175601e2 Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Mon, 9 Oct 2023 09:31:56 -0700 Subject: [PATCH] eval: expand coverage (#69) - Cover a number of additional error cases - Cover must-escape keys --- eval/testdata/eval/builtin-combine/env.yaml | 10 + .../eval/builtin-combine/expected.json | 854 ++++ eval/testdata/eval/builtin-errs/env.yaml | 10 + eval/testdata/eval/builtin-errs/expected.json | 1125 +++++ eval/testdata/eval/duplicate-keys/env.yaml | 6 + .../eval/duplicate-keys/expected.json | 253 + eval/testdata/eval/escape-keys/env.yaml | 5 + eval/testdata/eval/escape-keys/expected.json | 210 + eval/testdata/eval/interp/env.yaml | 5 + eval/testdata/eval/interp/expected.json | 759 ++- eval/testdata/eval/invalid-access/a.yaml | 5 + eval/testdata/eval/invalid-access/env.yaml | 42 + .../eval/invalid-access/expected.json | 4200 +++++++++++++++++ 13 files changed, 7372 insertions(+), 112 deletions(-) create mode 100644 eval/testdata/eval/builtin-combine/env.yaml create mode 100644 eval/testdata/eval/builtin-combine/expected.json create mode 100644 eval/testdata/eval/builtin-errs/env.yaml create mode 100644 eval/testdata/eval/builtin-errs/expected.json create mode 100644 eval/testdata/eval/duplicate-keys/env.yaml create mode 100644 eval/testdata/eval/duplicate-keys/expected.json create mode 100644 eval/testdata/eval/escape-keys/env.yaml create mode 100644 eval/testdata/eval/escape-keys/expected.json create mode 100644 eval/testdata/eval/invalid-access/a.yaml create mode 100644 eval/testdata/eval/invalid-access/env.yaml create mode 100644 eval/testdata/eval/invalid-access/expected.json diff --git a/eval/testdata/eval/builtin-combine/env.yaml b/eval/testdata/eval/builtin-combine/env.yaml new file mode 100644 index 00000000..1821c40d --- /dev/null +++ b/eval/testdata/eval/builtin-combine/env.yaml @@ -0,0 +1,10 @@ +values: + open: + fn::open::test: + foo: bar + password: { fn::secret: hunter2 } + builtins: + - { fn::join: [",", [ "${password}", "${open.foo}" ] ] } + - { fn::toBase64: "${password} ${open.foo}" } + - { fn::toJSON: "${password} ${open.foo}" } + - { fn::toString: "${password} ${open.foo}" } diff --git a/eval/testdata/eval/builtin-combine/expected.json b/eval/testdata/eval/builtin-combine/expected.json new file mode 100644 index 00000000..3166b679 --- /dev/null +++ b/eval/testdata/eval/builtin-combine/expected.json @@ -0,0 +1,854 @@ +{ + "environment": { + "exprs": { + "builtins": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 5, + "byte": 103 + }, + "end": { + "line": 10, + "column": 46, + "byte": 303 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 7, + "byte": 105 + }, + "end": { + "line": 7, + "column": 53, + "byte": 151 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::join", + "argSchema": { + "prefixItems": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "arg": { + "range": { + "begin": { + "line": 0, + "column": 0, + "byte": 0 + }, + "end": { + "line": 0, + "column": 0, + "byte": 0 + } + }, + "list": [ + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 20, + "byte": 118 + }, + "end": { + "line": 7, + "column": 21, + "byte": 119 + } + }, + "schema": { + "type": "string", + "const": "," + }, + "literal": "," + }, + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 25, + "byte": 123 + }, + "end": { + "line": 7, + "column": 53, + "byte": 151 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "hunter2" + }, + { + "type": "string", + "const": "bar" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 27, + "byte": 125 + }, + "end": { + "line": 7, + "column": 38, + "byte": 136 + } + }, + "schema": { + "type": "string", + "const": "hunter2" + }, + "symbol": [ + { + "key": "password", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 13, + "byte": 63 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + } + } + ] + }, + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 42, + "byte": 140 + }, + "end": { + "line": 7, + "column": 53, + "byte": 151 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "symbol": [ + { + "key": "open", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + }, + { + "key": "foo", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + ] + } + ] + } + ] + } + } + }, + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 8, + "column": 7, + "byte": 166 + }, + "end": { + "line": 8, + "column": 46, + "byte": 205 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toBase64", + "argSchema": { + "type": "string" + }, + "arg": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 8, + "column": 23, + "byte": 182 + }, + "end": { + "line": 8, + "column": 46, + "byte": 205 + } + }, + "schema": { + "type": "string" + }, + "interpolate": [ + { + "value": [ + { + "key": "password", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 13, + "byte": 63 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + } + } + ] + }, + { + "text": " ", + "value": [ + { + "key": "open", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + }, + { + "key": "foo", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + ] + } + ] + } + } + }, + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 9, + "column": 7, + "byte": 216 + }, + "end": { + "line": 9, + "column": 44, + "byte": 253 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toJSON", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 9, + "column": 21, + "byte": 230 + }, + "end": { + "line": 9, + "column": 44, + "byte": 253 + } + }, + "schema": { + "type": "string" + }, + "interpolate": [ + { + "value": [ + { + "key": "password", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 13, + "byte": 63 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + } + } + ] + }, + { + "text": " ", + "value": [ + { + "key": "open", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + }, + { + "key": "foo", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + ] + } + ] + } + } + }, + { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 10, + "column": 7, + "byte": 264 + }, + "end": { + "line": 10, + "column": 46, + "byte": 303 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toString", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 10, + "column": 23, + "byte": 280 + }, + "end": { + "line": 10, + "column": 46, + "byte": 303 + } + }, + "schema": { + "type": "string" + }, + "interpolate": [ + { + "value": [ + { + "key": "password", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 13, + "byte": 63 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + } + } + ] + }, + { + "text": " ", + "value": [ + { + "key": "open", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + }, + { + "key": "foo", + "value": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + ] + } + ] + } + } + } + ] + }, + "open": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "builtin": { + "name": "fn::open::test", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 4, + "column": 7, + "byte": 42 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "object": { + "foo": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 4, + "column": 12, + "byte": 47 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + } + } + } + } + }, + "password": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 13, + "byte": 63 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + }, + "schema": { + "type": "string", + "const": "hunter2" + }, + "builtin": { + "name": "fn::secret", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 27, + "byte": 77 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + }, + "schema": { + "type": "string", + "const": "hunter2" + }, + "literal": "hunter2" + } + } + } + }, + "properties": { + "builtins": { + "value": [ + { + "value": "hunter2,bar", + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 7, + "byte": 105 + }, + "end": { + "line": 7, + "column": 53, + "byte": 151 + } + } + } + }, + { + "value": "aHVudGVyMiBiYXI=", + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 8, + "column": 7, + "byte": 166 + }, + "end": { + "line": 8, + "column": 46, + "byte": 205 + } + } + } + }, + { + "value": "\"hunter2 bar\"", + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 9, + "column": 7, + "byte": 216 + }, + "end": { + "line": 9, + "column": 44, + "byte": 253 + } + } + } + }, + { + "value": "hunter2 bar", + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 10, + "column": 7, + "byte": 264 + }, + "end": { + "line": 10, + "column": 46, + "byte": 303 + } + } + } + } + ], + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 7, + "column": 5, + "byte": 103 + }, + "end": { + "line": 10, + "column": 46, + "byte": 303 + } + } + } + }, + "open": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + } + }, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 3, + "column": 5, + "byte": 20 + }, + "end": { + "line": 4, + "column": 15, + "byte": 50 + } + } + } + }, + "password": { + "value": "hunter2", + "secret": true, + "trace": { + "def": { + "environment": "builtin-combine", + "begin": { + "line": 5, + "column": 27, + "byte": 77 + }, + "end": { + "line": 5, + "column": 34, + "byte": 84 + } + } + } + } + }, + "schema": { + "properties": { + "builtins": { + "prefixItems": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "items": false, + "type": "array" + }, + "open": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "password": { + "type": "string", + "const": "hunter2" + } + }, + "type": "object", + "required": [ + "builtins", + "open", + "password" + ] + } + } +} \ No newline at end of file diff --git a/eval/testdata/eval/builtin-errs/env.yaml b/eval/testdata/eval/builtin-errs/env.yaml new file mode 100644 index 00000000..1a7fa931 --- /dev/null +++ b/eval/testdata/eval/builtin-errs/env.yaml @@ -0,0 +1,10 @@ +values: + number: 42 + builtins: + - { fn::open::test: "${missing}" } + - { fn::join: [",", "${missing}" ] } + - { fn::join: [",", [ "${number}" ] ] } + - { fn::toBase64: "${missing}" } + - { fn::toBase64: "${number}" } + - { fn::toJSON: "${missing}" } + - { fn::toString: "${missing}" } diff --git a/eval/testdata/eval/builtin-errs/expected.json b/eval/testdata/eval/builtin-errs/expected.json new file mode 100644 index 00000000..bfba48ba --- /dev/null +++ b/eval/testdata/eval/builtin-errs/expected.json @@ -0,0 +1,1125 @@ +{ + "checkDiags": [ + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 4, + "Column": 25, + "Byte": 57 + }, + "End": { + "Line": 4, + "Column": 35, + "Byte": 67 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 5, + "Column": 25, + "Byte": 96 + }, + "End": { + "Line": 5, + "Column": 35, + "Byte": 106 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "expected string, got number", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 6, + "Column": 27, + "Byte": 139 + }, + "End": { + "Line": 6, + "Column": 36, + "Byte": 148 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 7, + "Column": 23, + "Byte": 179 + }, + "End": { + "Line": 7, + "Column": 33, + "Byte": 189 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "expected string, got number", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 8, + "Column": 23, + "Byte": 216 + }, + "End": { + "Line": 8, + "Column": 32, + "Byte": 225 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 9, + "Column": 21, + "Byte": 250 + }, + "End": { + "Line": 9, + "Column": 31, + "Byte": 260 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 10, + "Column": 23, + "Byte": 287 + }, + "End": { + "Line": 10, + "Column": 33, + "Byte": 297 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "evalDiags": [ + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 4, + "Column": 25, + "Byte": 57 + }, + "End": { + "Line": 4, + "Column": 35, + "Byte": 67 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 5, + "Column": 25, + "Byte": 96 + }, + "End": { + "Line": 5, + "Column": 35, + "Byte": 106 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "expected string, got number", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 6, + "Column": 27, + "Byte": 139 + }, + "End": { + "Line": 6, + "Column": 36, + "Byte": 148 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 7, + "Column": 23, + "Byte": 179 + }, + "End": { + "Line": 7, + "Column": 33, + "Byte": 189 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "expected string, got number", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 8, + "Column": 23, + "Byte": 216 + }, + "End": { + "Line": 8, + "Column": 32, + "Byte": 225 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 9, + "Column": 21, + "Byte": 250 + }, + "End": { + "Line": 9, + "Column": 31, + "Byte": 260 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"missing\"", + "Detail": "", + "Subject": { + "Filename": "builtin-errs", + "Start": { + "Line": 10, + "Column": 23, + "Byte": 287 + }, + "End": { + "Line": 10, + "Column": 33, + "Byte": 297 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "environment": { + "exprs": { + "builtins": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 5, + "byte": 37 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + }, + "schema": { + "prefixItems": [ + true, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 7, + "byte": 39 + }, + "end": { + "line": 4, + "column": 35, + "byte": 67 + } + }, + "schema": true, + "builtin": { + "name": "fn::open::test", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 25, + "byte": 57 + }, + "end": { + "line": 4, + "column": 35, + "byte": 67 + } + }, + "schema": true, + "symbol": [ + { + "key": "missing", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 25, + "byte": 57 + }, + "end": { + "line": 4, + "column": 35, + "byte": 67 + } + } + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 5, + "column": 7, + "byte": 78 + }, + "end": { + "line": 5, + "column": 35, + "byte": 106 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::join", + "argSchema": { + "prefixItems": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "arg": { + "range": { + "begin": { + "line": 0, + "column": 0, + "byte": 0 + }, + "end": { + "line": 0, + "column": 0, + "byte": 0 + } + }, + "list": [ + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 5, + "column": 20, + "byte": 91 + }, + "end": { + "line": 5, + "column": 21, + "byte": 92 + } + }, + "schema": { + "type": "string", + "const": "," + }, + "literal": "," + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 5, + "column": 25, + "byte": 96 + }, + "end": { + "line": 5, + "column": 35, + "byte": 106 + } + }, + "schema": true, + "symbol": [ + { + "key": "missing", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 5, + "column": 25, + "byte": 96 + }, + "end": { + "line": 5, + "column": 35, + "byte": 106 + } + } + } + ] + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 6, + "column": 7, + "byte": 119 + }, + "end": { + "line": 6, + "column": 36, + "byte": 148 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::join", + "argSchema": { + "prefixItems": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "arg": { + "range": { + "begin": { + "line": 0, + "column": 0, + "byte": 0 + }, + "end": { + "line": 0, + "column": 0, + "byte": 0 + } + }, + "list": [ + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 6, + "column": 20, + "byte": 132 + }, + "end": { + "line": 6, + "column": 21, + "byte": 133 + } + }, + "schema": { + "type": "string", + "const": "," + }, + "literal": "," + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 6, + "column": 25, + "byte": 137 + }, + "end": { + "line": 6, + "column": 36, + "byte": 148 + } + }, + "schema": { + "prefixItems": [ + { + "type": "number", + "const": 42 + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 6, + "column": 27, + "byte": 139 + }, + "end": { + "line": 6, + "column": 36, + "byte": 148 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "symbol": [ + { + "key": "number", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 2, + "column": 11, + "byte": 18 + }, + "end": { + "line": 2, + "column": 13, + "byte": 20 + } + } + } + ] + } + ] + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 7, + "column": 7, + "byte": 163 + }, + "end": { + "line": 7, + "column": 33, + "byte": 189 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toBase64", + "argSchema": { + "type": "string" + }, + "arg": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 7, + "column": 23, + "byte": 179 + }, + "end": { + "line": 7, + "column": 33, + "byte": 189 + } + }, + "schema": true, + "symbol": [ + { + "key": "missing", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 7, + "column": 23, + "byte": 179 + }, + "end": { + "line": 7, + "column": 33, + "byte": 189 + } + } + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 8, + "column": 7, + "byte": 200 + }, + "end": { + "line": 8, + "column": 32, + "byte": 225 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toBase64", + "argSchema": { + "type": "string" + }, + "arg": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 8, + "column": 23, + "byte": 216 + }, + "end": { + "line": 8, + "column": 32, + "byte": 225 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "symbol": [ + { + "key": "number", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 2, + "column": 11, + "byte": 18 + }, + "end": { + "line": 2, + "column": 13, + "byte": 20 + } + } + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 9, + "column": 7, + "byte": 236 + }, + "end": { + "line": 9, + "column": 31, + "byte": 260 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toJSON", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 9, + "column": 21, + "byte": 250 + }, + "end": { + "line": 9, + "column": 31, + "byte": 260 + } + }, + "schema": true, + "symbol": [ + { + "key": "missing", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 9, + "column": 21, + "byte": 250 + }, + "end": { + "line": 9, + "column": 31, + "byte": 260 + } + } + } + ] + } + } + }, + { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 10, + "column": 7, + "byte": 271 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + }, + "schema": { + "type": "string" + }, + "builtin": { + "name": "fn::toString", + "argSchema": true, + "arg": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 10, + "column": 23, + "byte": 287 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + }, + "schema": true, + "symbol": [ + { + "key": "missing", + "value": { + "environment": "builtin-errs", + "begin": { + "line": 10, + "column": 23, + "byte": 287 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + } + } + ] + } + } + } + ] + }, + "number": { + "range": { + "environment": "builtin-errs", + "begin": { + "line": 2, + "column": 11, + "byte": 18 + }, + "end": { + "line": 2, + "column": 13, + "byte": 20 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "literal": 42 + } + }, + "properties": { + "builtins": { + "value": [ + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 7, + "byte": 39 + }, + "end": { + "line": 4, + "column": 35, + "byte": 67 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 5, + "column": 7, + "byte": 78 + }, + "end": { + "line": 5, + "column": 35, + "byte": 106 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 6, + "column": 7, + "byte": 119 + }, + "end": { + "line": 6, + "column": 36, + "byte": 148 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 7, + "column": 7, + "byte": 163 + }, + "end": { + "line": 7, + "column": 33, + "byte": 189 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 8, + "column": 7, + "byte": 200 + }, + "end": { + "line": 8, + "column": 32, + "byte": 225 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 9, + "column": 7, + "byte": 236 + }, + "end": { + "line": 9, + "column": 31, + "byte": 260 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 10, + "column": 7, + "byte": 271 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + } + } + } + ], + "unknown": true, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 4, + "column": 5, + "byte": 37 + }, + "end": { + "line": 10, + "column": 33, + "byte": 297 + } + } + } + }, + "number": { + "value": 42, + "trace": { + "def": { + "environment": "builtin-errs", + "begin": { + "line": 2, + "column": 11, + "byte": 18 + }, + "end": { + "line": 2, + "column": 13, + "byte": 20 + } + } + } + } + }, + "schema": { + "properties": { + "builtins": { + "prefixItems": [ + true, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "items": false, + "type": "array" + }, + "number": { + "type": "number", + "const": 42 + } + }, + "type": "object", + "required": [ + "builtins", + "number" + ] + } + } +} \ No newline at end of file diff --git a/eval/testdata/eval/duplicate-keys/env.yaml b/eval/testdata/eval/duplicate-keys/env.yaml new file mode 100644 index 00000000..38d5c4cb --- /dev/null +++ b/eval/testdata/eval/duplicate-keys/env.yaml @@ -0,0 +1,6 @@ +values: + foo: bar + foo: baz + qux: + foo: bar + foo: baz diff --git a/eval/testdata/eval/duplicate-keys/expected.json b/eval/testdata/eval/duplicate-keys/expected.json new file mode 100644 index 00000000..fe10215f --- /dev/null +++ b/eval/testdata/eval/duplicate-keys/expected.json @@ -0,0 +1,253 @@ +{ + "checkDiags": [ + { + "Severity": 1, + "Summary": "duplicate key \"foo\"", + "Detail": "", + "Subject": { + "Filename": "duplicate-keys", + "Start": { + "Line": 3, + "Column": 3, + "Byte": 21 + }, + "End": { + "Line": 3, + "Column": 6, + "Byte": 24 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "duplicate key \"foo\"", + "Detail": "", + "Subject": { + "Filename": "duplicate-keys", + "Start": { + "Line": 6, + "Column": 5, + "Byte": 54 + }, + "End": { + "Line": 6, + "Column": 8, + "Byte": 57 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "evalDiags": [ + { + "Severity": 1, + "Summary": "duplicate key \"foo\"", + "Detail": "", + "Subject": { + "Filename": "duplicate-keys", + "Start": { + "Line": 3, + "Column": 3, + "Byte": 21 + }, + "End": { + "Line": 3, + "Column": 6, + "Byte": 24 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "duplicate key \"foo\"", + "Detail": "", + "Subject": { + "Filename": "duplicate-keys", + "Start": { + "Line": 6, + "Column": 5, + "Byte": 54 + }, + "End": { + "Line": 6, + "Column": 8, + "Byte": 57 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "environment": { + "exprs": { + "foo": { + "range": { + "environment": "duplicate-keys", + "begin": { + "line": 2, + "column": 8, + "byte": 15 + }, + "end": { + "line": 2, + "column": 11, + "byte": 18 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + }, + "qux": { + "range": { + "environment": "duplicate-keys", + "begin": { + "line": 5, + "column": 5, + "byte": 41 + }, + "end": { + "line": 6, + "column": 13, + "byte": 62 + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "object": { + "foo": { + "range": { + "environment": "duplicate-keys", + "begin": { + "line": 5, + "column": 10, + "byte": 46 + }, + "end": { + "line": 5, + "column": 13, + "byte": 49 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + } + } + } + }, + "properties": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "duplicate-keys", + "begin": { + "line": 2, + "column": 8, + "byte": 15 + }, + "end": { + "line": 2, + "column": 11, + "byte": 18 + } + } + } + }, + "qux": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "duplicate-keys", + "begin": { + "line": 5, + "column": 10, + "byte": 46 + }, + "end": { + "line": 5, + "column": 13, + "byte": 49 + } + } + } + } + }, + "trace": { + "def": { + "environment": "duplicate-keys", + "begin": { + "line": 5, + "column": 5, + "byte": 41 + }, + "end": { + "line": 6, + "column": 13, + "byte": 62 + } + } + } + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + }, + "qux": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + } + }, + "type": "object", + "required": [ + "foo", + "qux" + ] + } + } +} \ No newline at end of file diff --git a/eval/testdata/eval/escape-keys/env.yaml b/eval/testdata/eval/escape-keys/env.yaml new file mode 100644 index 00000000..fad742f9 --- /dev/null +++ b/eval/testdata/eval/escape-keys/env.yaml @@ -0,0 +1,5 @@ +values: + object: + with-hyphen: foo + 0leadingDigit: bar + "\"quoted\"": baz diff --git a/eval/testdata/eval/escape-keys/expected.json b/eval/testdata/eval/escape-keys/expected.json new file mode 100644 index 00000000..52b91fe3 --- /dev/null +++ b/eval/testdata/eval/escape-keys/expected.json @@ -0,0 +1,210 @@ +{ + "environment": { + "exprs": { + "object": { + "range": { + "environment": "escape-keys", + "begin": { + "line": 3, + "column": 5, + "byte": 22 + }, + "end": { + "line": 5, + "column": 22, + "byte": 83 + } + }, + "schema": { + "properties": { + "\"quoted\"": { + "type": "string", + "const": "baz" + }, + "0leadingDigit": { + "type": "string", + "const": "bar" + }, + "with-hyphen": { + "type": "string", + "const": "foo" + } + }, + "type": "object", + "required": [ + "\"quoted\"", + "0leadingDigit", + "with-hyphen" + ] + }, + "object": { + "\"quoted\"": { + "range": { + "environment": "escape-keys", + "begin": { + "line": 5, + "column": 19, + "byte": 80 + }, + "end": { + "line": 5, + "column": 22, + "byte": 83 + } + }, + "schema": { + "type": "string", + "const": "baz" + }, + "literal": "baz" + }, + "0leadingDigit": { + "range": { + "environment": "escape-keys", + "begin": { + "line": 4, + "column": 20, + "byte": 58 + }, + "end": { + "line": 4, + "column": 23, + "byte": 61 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + }, + "with-hyphen": { + "range": { + "environment": "escape-keys", + "begin": { + "line": 3, + "column": 18, + "byte": 35 + }, + "end": { + "line": 3, + "column": 21, + "byte": 38 + } + }, + "schema": { + "type": "string", + "const": "foo" + }, + "literal": "foo" + } + } + } + }, + "properties": { + "object": { + "value": { + "\"quoted\"": { + "value": "baz", + "trace": { + "def": { + "environment": "escape-keys", + "begin": { + "line": 5, + "column": 19, + "byte": 80 + }, + "end": { + "line": 5, + "column": 22, + "byte": 83 + } + } + } + }, + "0leadingDigit": { + "value": "bar", + "trace": { + "def": { + "environment": "escape-keys", + "begin": { + "line": 4, + "column": 20, + "byte": 58 + }, + "end": { + "line": 4, + "column": 23, + "byte": 61 + } + } + } + }, + "with-hyphen": { + "value": "foo", + "trace": { + "def": { + "environment": "escape-keys", + "begin": { + "line": 3, + "column": 18, + "byte": 35 + }, + "end": { + "line": 3, + "column": 21, + "byte": 38 + } + } + } + } + }, + "trace": { + "def": { + "environment": "escape-keys", + "begin": { + "line": 3, + "column": 5, + "byte": 22 + }, + "end": { + "line": 5, + "column": 22, + "byte": 83 + } + } + } + } + }, + "schema": { + "properties": { + "object": { + "properties": { + "\"quoted\"": { + "type": "string", + "const": "baz" + }, + "0leadingDigit": { + "type": "string", + "const": "bar" + }, + "with-hyphen": { + "type": "string", + "const": "foo" + } + }, + "type": "object", + "required": [ + "\"quoted\"", + "0leadingDigit", + "with-hyphen" + ] + } + }, + "type": "object", + "required": [ + "object" + ] + } + } +} \ No newline at end of file diff --git a/eval/testdata/eval/interp/env.yaml b/eval/testdata/eval/interp/env.yaml index 4155b0fa..aafc0baa 100644 --- a/eval/testdata/eval/interp/env.yaml +++ b/eval/testdata/eval/interp/env.yaml @@ -2,6 +2,8 @@ values: a: p: ${a.q} q: foo + s: { fn::secret: [ shhhh ] } + t: { fn::secret: { password: hunter2 } } b: p: ${a.p} c: @@ -10,3 +12,6 @@ values: - hello, ${c.b} - ${c.a[0]} bar b: world! + s: + - ${a.s[0]} + - ${a.t.password} diff --git a/eval/testdata/eval/interp/expected.json b/eval/testdata/eval/interp/expected.json index acc08c44..3b242ecc 100644 --- a/eval/testdata/eval/interp/expected.json +++ b/eval/testdata/eval/interp/expected.json @@ -10,9 +10,9 @@ "byte": 17 }, "end": { - "line": 4, - "column": 11, - "byte": 37 + "line": 6, + "column": 41, + "byte": 111 } }, "schema": { @@ -24,12 +24,36 @@ "q": { "type": "string", "const": "foo" + }, + "s": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + } + ], + "items": false, + "type": "array" + }, + "t": { + "properties": { + "password": { + "type": "string", + "const": "hunter2" + } + }, + "type": "object", + "required": [ + "password" + ] } }, "type": "object", "required": [ "p", - "q" + "q", + "s", + "t" ] }, "object": { @@ -62,9 +86,9 @@ "byte": 17 }, "end": { - "line": 4, - "column": 11, - "byte": 37 + "line": 6, + "column": 41, + "byte": 111 } } }, @@ -105,6 +129,162 @@ "const": "foo" }, "literal": "foo" + }, + "s": { + "range": { + "environment": "interp", + "begin": { + "line": 5, + "column": 8, + "byte": 45 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + } + ], + "items": false, + "type": "array" + }, + "builtin": { + "name": "fn::secret", + "argSchema": true, + "arg": { + "range": { + "environment": "interp", + "begin": { + "line": 5, + "column": 22, + "byte": 59 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "interp", + "begin": { + "line": 5, + "column": 24, + "byte": 61 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + }, + "schema": { + "type": "string", + "const": "shhhh" + }, + "literal": "shhhh" + } + ] + } + } + }, + "t": { + "range": { + "environment": "interp", + "begin": { + "line": 6, + "column": 8, + "byte": 78 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + }, + "schema": { + "properties": { + "password": { + "type": "string", + "const": "hunter2" + } + }, + "type": "object", + "required": [ + "password" + ] + }, + "builtin": { + "name": "fn::secret", + "argSchema": true, + "arg": { + "range": { + "environment": "interp", + "begin": { + "line": 6, + "column": 22, + "byte": 92 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + }, + "schema": { + "properties": { + "password": { + "type": "string", + "const": "hunter2" + } + }, + "type": "object", + "required": [ + "password" + ] + }, + "object": { + "password": { + "range": { + "environment": "interp", + "begin": { + "line": 6, + "column": 34, + "byte": 104 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + }, + "schema": { + "type": "string", + "const": "hunter2" + }, + "literal": "hunter2" + } + } + } + } } } }, @@ -112,14 +292,14 @@ "range": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 5, - "byte": 47 + "byte": 125 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } }, "schema": { @@ -139,14 +319,14 @@ "range": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 8, - "byte": 50 + "byte": 128 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } }, "schema": { @@ -164,9 +344,9 @@ "byte": 17 }, "end": { - "line": 4, - "column": 11, - "byte": 37 + "line": 6, + "column": 41, + "byte": 111 } } }, @@ -194,14 +374,14 @@ "range": { "environment": "interp", "begin": { - "line": 8, + "line": 10, "column": 5, - "byte": 66 + "byte": 144 }, "end": { - "line": 12, - "column": 14, - "byte": 141 + "line": 17, + "column": 24, + "byte": 268 } }, "schema": { @@ -225,12 +405,27 @@ "b": { "type": "string", "const": "world!" + }, + "s": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + }, + { + "type": "string", + "const": "hunter2" + } + ], + "items": false, + "type": "array" } }, "type": "object", "required": [ "a", - "b" + "b", + "s" ] }, "object": { @@ -238,14 +433,14 @@ "range": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 7, - "byte": 75 + "byte": 153 }, "end": { - "line": 11, + "line": 13, "column": 22, - "byte": 127 + "byte": 205 } }, "schema": { @@ -269,14 +464,14 @@ "range": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 9, - "byte": 77 + "byte": 155 }, "end": { - "line": 9, + "line": 11, "column": 15, - "byte": 83 + "byte": 161 } }, "schema": { @@ -289,14 +484,14 @@ "value": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 5, - "byte": 47 + "byte": 125 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } } }, @@ -305,14 +500,14 @@ "value": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 8, - "byte": 50 + "byte": 128 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } } } @@ -322,14 +517,14 @@ "range": { "environment": "interp", "begin": { - "line": 10, + "line": 12, "column": 9, - "byte": 92 + "byte": 170 }, "end": { - "line": 10, + "line": 12, "column": 22, - "byte": 105 + "byte": 183 } }, "schema": { @@ -344,14 +539,14 @@ "value": { "environment": "interp", "begin": { - "line": 8, + "line": 10, "column": 5, - "byte": 66 + "byte": 144 }, "end": { - "line": 12, - "column": 14, - "byte": 141 + "line": 17, + "column": 24, + "byte": 268 } } }, @@ -360,14 +555,14 @@ "value": { "environment": "interp", "begin": { - "line": 12, + "line": 14, "column": 8, - "byte": 135 + "byte": 213 }, "end": { - "line": 12, + "line": 14, "column": 14, - "byte": 141 + "byte": 219 } } } @@ -379,14 +574,14 @@ "range": { "environment": "interp", "begin": { - "line": 11, + "line": 13, "column": 9, - "byte": 114 + "byte": 192 }, "end": { - "line": 11, + "line": 13, "column": 22, - "byte": 127 + "byte": 205 } }, "schema": { @@ -400,14 +595,14 @@ "value": { "environment": "interp", "begin": { - "line": 8, + "line": 10, "column": 5, - "byte": 66 + "byte": 144 }, "end": { - "line": 12, - "column": 14, - "byte": 141 + "line": 17, + "column": 24, + "byte": 268 } } }, @@ -416,14 +611,14 @@ "value": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 7, - "byte": 75 + "byte": 153 }, "end": { - "line": 11, + "line": 13, "column": 22, - "byte": 127 + "byte": 205 } } }, @@ -432,14 +627,14 @@ "value": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 9, - "byte": 77 + "byte": 155 }, "end": { - "line": 9, + "line": 11, "column": 15, - "byte": 83 + "byte": 161 } } } @@ -456,14 +651,14 @@ "range": { "environment": "interp", "begin": { - "line": 12, + "line": 14, "column": 8, - "byte": 135 + "byte": 213 }, "end": { - "line": 12, + "line": 14, "column": 14, - "byte": 141 + "byte": 219 } }, "schema": { @@ -471,6 +666,175 @@ "const": "world!" }, "literal": "world!" + }, + "s": { + "range": { + "environment": "interp", + "begin": { + "line": 16, + "column": 7, + "byte": 233 + }, + "end": { + "line": 17, + "column": 24, + "byte": 268 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + }, + { + "type": "string", + "const": "hunter2" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "interp", + "begin": { + "line": 16, + "column": 9, + "byte": 235 + }, + "end": { + "line": 16, + "column": 18, + "byte": 244 + } + }, + "schema": { + "type": "string", + "const": "shhhh" + }, + "symbol": [ + { + "key": "a", + "value": { + "environment": "interp", + "begin": { + "line": 3, + "column": 5, + "byte": 17 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + }, + { + "key": "s", + "value": { + "environment": "interp", + "begin": { + "line": 5, + "column": 8, + "byte": 45 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + } + }, + { + "index": 0, + "value": { + "environment": "interp", + "begin": { + "line": 5, + "column": 24, + "byte": 61 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + } + } + ] + }, + { + "range": { + "environment": "interp", + "begin": { + "line": 17, + "column": 9, + "byte": 253 + }, + "end": { + "line": 17, + "column": 24, + "byte": 268 + } + }, + "schema": { + "type": "string", + "const": "hunter2" + }, + "symbol": [ + { + "key": "a", + "value": { + "environment": "interp", + "begin": { + "line": 3, + "column": 5, + "byte": 17 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + }, + { + "key": "t", + "value": { + "environment": "interp", + "begin": { + "line": 6, + "column": 8, + "byte": 78 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + }, + { + "key": "password", + "value": { + "environment": "interp", + "begin": { + "line": 6, + "column": 34, + "byte": 104 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + } + ] + } + ] } } } @@ -513,8 +877,85 @@ } } } + }, + "s": { + "value": [ + { + "value": "shhhh", + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 5, + "column": 24, + "byte": 61 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + } + } + } + ], + "secret": true, + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 5, + "column": 22, + "byte": 59 + }, + "end": { + "line": 5, + "column": 29, + "byte": 66 + } + } + } + }, + "t": { + "value": { + "password": { + "value": "hunter2", + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 6, + "column": 34, + "byte": 104 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + } + } + }, + "secret": true, + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 6, + "column": 22, + "byte": 92 + }, + "end": { + "line": 6, + "column": 41, + "byte": 111 + } + } + } } }, + "secret": true, "trace": { "def": { "environment": "interp", @@ -524,9 +965,9 @@ "byte": 17 }, "end": { - "line": 4, - "column": 11, - "byte": 37 + "line": 6, + "column": 41, + "byte": 111 } } } @@ -539,14 +980,14 @@ "def": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 8, - "byte": 50 + "byte": 128 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } } } @@ -556,14 +997,14 @@ "def": { "environment": "interp", "begin": { - "line": 6, + "line": 8, "column": 5, - "byte": 47 + "byte": 125 }, "end": { - "line": 6, + "line": 8, "column": 14, - "byte": 56 + "byte": 134 } } } @@ -578,14 +1019,14 @@ "def": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 9, - "byte": 77 + "byte": 155 }, "end": { - "line": 9, + "line": 11, "column": 15, - "byte": 83 + "byte": 161 } } } @@ -596,14 +1037,14 @@ "def": { "environment": "interp", "begin": { - "line": 10, + "line": 12, "column": 9, - "byte": 92 + "byte": 170 }, "end": { - "line": 10, + "line": 12, "column": 22, - "byte": 105 + "byte": 183 } } } @@ -614,14 +1055,14 @@ "def": { "environment": "interp", "begin": { - "line": 11, + "line": 13, "column": 9, - "byte": 114 + "byte": 192 }, "end": { - "line": 11, + "line": 13, "column": 22, - "byte": 127 + "byte": 205 } } } @@ -631,14 +1072,14 @@ "def": { "environment": "interp", "begin": { - "line": 9, + "line": 11, "column": 7, - "byte": 75 + "byte": 153 }, "end": { - "line": 11, + "line": 13, "column": 22, - "byte": 127 + "byte": 205 } } } @@ -649,14 +1090,69 @@ "def": { "environment": "interp", "begin": { - "line": 12, + "line": 14, "column": 8, - "byte": 135 + "byte": 213 }, "end": { - "line": 12, + "line": 14, "column": 14, - "byte": 141 + "byte": 219 + } + } + } + }, + "s": { + "value": [ + { + "value": "shhhh", + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 16, + "column": 9, + "byte": 235 + }, + "end": { + "line": 16, + "column": 18, + "byte": 244 + } + } + } + }, + { + "value": "hunter2", + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 17, + "column": 9, + "byte": 253 + }, + "end": { + "line": 17, + "column": 24, + "byte": 268 + } + } + } + } + ], + "trace": { + "def": { + "environment": "interp", + "begin": { + "line": 16, + "column": 7, + "byte": 233 + }, + "end": { + "line": 17, + "column": 24, + "byte": 268 } } } @@ -666,14 +1162,14 @@ "def": { "environment": "interp", "begin": { - "line": 8, + "line": 10, "column": 5, - "byte": 66 + "byte": 144 }, "end": { - "line": 12, - "column": 14, - "byte": 141 + "line": 17, + "column": 24, + "byte": 268 } } } @@ -690,12 +1186,36 @@ "q": { "type": "string", "const": "foo" + }, + "s": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + } + ], + "items": false, + "type": "array" + }, + "t": { + "properties": { + "password": { + "type": "string", + "const": "hunter2" + } + }, + "type": "object", + "required": [ + "password" + ] } }, "type": "object", "required": [ "p", - "q" + "q", + "s", + "t" ] }, "b": { @@ -731,12 +1251,27 @@ "b": { "type": "string", "const": "world!" + }, + "s": { + "prefixItems": [ + { + "type": "string", + "const": "shhhh" + }, + { + "type": "string", + "const": "hunter2" + } + ], + "items": false, + "type": "array" } }, "type": "object", "required": [ "a", - "b" + "b", + "s" ] } }, diff --git a/eval/testdata/eval/invalid-access/a.yaml b/eval/testdata/eval/invalid-access/a.yaml new file mode 100644 index 00000000..e12ec5f3 --- /dev/null +++ b/eval/testdata/eval/invalid-access/a.yaml @@ -0,0 +1,5 @@ +values: + object: + baz: qux + otherObject: + foo: bar diff --git a/eval/testdata/eval/invalid-access/env.yaml b/eval/testdata/eval/invalid-access/env.yaml new file mode 100644 index 00000000..63c04886 --- /dev/null +++ b/eval/testdata/eval/invalid-access/env.yaml @@ -0,0 +1,42 @@ +imports: + - a + - a +values: + string: esc + array: [1, 2, 3] + object: + hello: world + myObject: + foo: bar + open: + fn::open::schema: + "null": null + boolean: true + "false": false + "true": true + number: 42 + pi: 3.14 + string: esc + hello: hello + array: [ 2, items, { some: object }, [ array ] ] + tuple: [ hello, world ] + map: { hello: world, blue: 42 } + record: { foo: bar } + anyOf: hello + oneOf: 42 + ref: { baz: qux } + errors: + - ${string.foo} + - ${array.foo} + - ${array["foo"]} + - ${array[3]} + - ${array[-1]} + - ${object[1]} + - ${object.bar} + - ${myObject.bar} + - ${otherObject[0]} + - ${open.string.foo} + - ${open.array.foo} + - ${open.array["foo"]} + - ${open.record[1]} + diff --git a/eval/testdata/eval/invalid-access/expected.json b/eval/testdata/eval/invalid-access/expected.json new file mode 100644 index 00000000..ada25ec5 --- /dev/null +++ b/eval/testdata/eval/invalid-access/expected.json @@ -0,0 +1,4200 @@ +{ + "checkDiags": [ + { + "Severity": 1, + "Summary": "receiver must be an array or an object", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 29, + "Column": 7, + "Byte": 517 + }, + "End": { + "Line": 29, + "Column": 20, + "Byte": 530 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 30, + "Column": 7, + "Byte": 537 + }, + "End": { + "Line": 30, + "Column": 19, + "Byte": 549 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 31, + "Column": 7, + "Byte": 556 + }, + "End": { + "Line": 31, + "Column": 22, + "Byte": 571 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "array index 3 out-of-bounds for array of length 3", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 32, + "Column": 7, + "Byte": 578 + }, + "End": { + "Line": 32, + "Column": 18, + "Byte": 589 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "array indices must not be negative", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 33, + "Column": 7, + "Byte": 596 + }, + "End": { + "Line": 33, + "Column": 19, + "Byte": 608 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 34, + "Column": 7, + "Byte": 615 + }, + "End": { + "Line": 34, + "Column": 19, + "Byte": 627 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"bar\"", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 35, + "Column": 7, + "Byte": 634 + }, + "End": { + "Line": 35, + "Column": 20, + "Byte": 647 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"bar\"", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 36, + "Column": 7, + "Byte": 654 + }, + "End": { + "Line": 36, + "Column": 22, + "Byte": 669 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 37, + "Column": 7, + "Byte": 676 + }, + "End": { + "Line": 37, + "Column": 24, + "Byte": 693 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "receiver must be an array or an object", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 38, + "Column": 7, + "Byte": 700 + }, + "End": { + "Line": 38, + "Column": 25, + "Byte": 718 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 39, + "Column": 7, + "Byte": 725 + }, + "End": { + "Line": 39, + "Column": 24, + "Byte": 742 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 40, + "Column": 7, + "Byte": 749 + }, + "End": { + "Line": 40, + "Column": 27, + "Byte": 769 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 41, + "Column": 7, + "Byte": 776 + }, + "End": { + "Line": 41, + "Column": 24, + "Byte": 793 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "evalDiags": [ + { + "Severity": 1, + "Summary": "receiver must be an array or an object", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 29, + "Column": 7, + "Byte": 517 + }, + "End": { + "Line": 29, + "Column": 20, + "Byte": 530 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 30, + "Column": 7, + "Byte": 537 + }, + "End": { + "Line": 30, + "Column": 19, + "Byte": 549 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 31, + "Column": 7, + "Byte": 556 + }, + "End": { + "Line": 31, + "Column": 22, + "Byte": 571 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "array index 3 out-of-bounds for array of length 3", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 32, + "Column": 7, + "Byte": 578 + }, + "End": { + "Line": 32, + "Column": 18, + "Byte": 589 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "array indices must not be negative", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 33, + "Column": 7, + "Byte": 596 + }, + "End": { + "Line": 33, + "Column": 19, + "Byte": 608 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 34, + "Column": 7, + "Byte": 615 + }, + "End": { + "Line": 34, + "Column": 19, + "Byte": 627 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"bar\"", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 35, + "Column": 7, + "Byte": 634 + }, + "End": { + "Line": 35, + "Column": 20, + "Byte": 647 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "unknown property \"bar\"", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 36, + "Column": 7, + "Byte": 654 + }, + "End": { + "Line": 36, + "Column": 22, + "Byte": 669 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 37, + "Column": 7, + "Byte": 676 + }, + "End": { + "Line": 37, + "Column": 24, + "Byte": 693 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "receiver must be an array or an object", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 38, + "Column": 7, + "Byte": 700 + }, + "End": { + "Line": 38, + "Column": 25, + "Byte": 718 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 39, + "Column": 7, + "Byte": 725 + }, + "End": { + "Line": 39, + "Column": 24, + "Byte": 742 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an array element using a property name", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 40, + "Column": 7, + "Byte": 749 + }, + "End": { + "Line": 40, + "Column": 27, + "Byte": 769 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + }, + { + "Severity": 1, + "Summary": "cannot access an object property using an integer index", + "Detail": "", + "Subject": { + "Filename": "invalid-access", + "Start": { + "Line": 41, + "Column": 7, + "Byte": 776 + }, + "End": { + "Line": 41, + "Column": 24, + "Byte": 793 + } + }, + "Context": null, + "Expression": null, + "EvalContext": null, + "Extra": null, + "Shown": false + } + ], + "environment": { + "exprs": { + "array": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + }, + "schema": { + "prefixItems": [ + { + "type": "number", + "const": 1 + }, + { + "type": "number", + "const": 2 + }, + { + "type": "number", + "const": 3 + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 11, + "byte": 53 + }, + "end": { + "line": 6, + "column": 12, + "byte": 54 + } + }, + "schema": { + "type": "number", + "const": 1 + }, + "literal": 1 + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 14, + "byte": 56 + }, + "end": { + "line": 6, + "column": 15, + "byte": 57 + } + }, + "schema": { + "type": "number", + "const": 2 + }, + "literal": 2 + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 17, + "byte": 59 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + }, + "schema": { + "type": "number", + "const": 3 + }, + "literal": 3 + } + ] + }, + "errors": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 29, + "column": 5, + "byte": 515 + }, + "end": { + "line": 41, + "column": 24, + "byte": 793 + } + }, + "schema": { + "prefixItems": [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 29, + "column": 7, + "byte": 517 + }, + "end": { + "line": 29, + "column": 20, + "byte": 530 + } + }, + "schema": true, + "symbol": [ + { + "key": "string", + "value": { + "environment": "invalid-access", + "begin": { + "line": 5, + "column": 11, + "byte": 39 + }, + "end": { + "line": 5, + "column": 14, + "byte": 42 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 29, + "column": 7, + "byte": 517 + }, + "end": { + "line": 29, + "column": 20, + "byte": 530 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 30, + "column": 7, + "byte": 537 + }, + "end": { + "line": 30, + "column": 19, + "byte": 549 + } + }, + "schema": true, + "symbol": [ + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 30, + "column": 7, + "byte": 537 + }, + "end": { + "line": 30, + "column": 19, + "byte": 549 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 31, + "column": 7, + "byte": 556 + }, + "end": { + "line": 31, + "column": 22, + "byte": 571 + } + }, + "schema": true, + "symbol": [ + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 31, + "column": 7, + "byte": 556 + }, + "end": { + "line": 31, + "column": 22, + "byte": 571 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 32, + "column": 7, + "byte": 578 + }, + "end": { + "line": 32, + "column": 18, + "byte": 589 + } + }, + "schema": true, + "symbol": [ + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + }, + { + "index": 3, + "value": { + "environment": "invalid-access", + "begin": { + "line": 32, + "column": 7, + "byte": 578 + }, + "end": { + "line": 32, + "column": 18, + "byte": 589 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 33, + "column": 7, + "byte": 596 + }, + "end": { + "line": 33, + "column": 19, + "byte": 608 + } + }, + "schema": true, + "symbol": [ + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + }, + { + "index": -1, + "value": { + "environment": "invalid-access", + "begin": { + "line": 33, + "column": 7, + "byte": 596 + }, + "end": { + "line": 33, + "column": 19, + "byte": 608 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 34, + "column": 7, + "byte": 615 + }, + "end": { + "line": 34, + "column": 19, + "byte": 627 + } + }, + "schema": true, + "symbol": [ + { + "key": "object", + "value": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 5, + "byte": 76 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + } + }, + { + "index": 1, + "value": { + "environment": "invalid-access", + "begin": { + "line": 34, + "column": 7, + "byte": 615 + }, + "end": { + "line": 34, + "column": 19, + "byte": 627 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 35, + "column": 7, + "byte": 634 + }, + "end": { + "line": 35, + "column": 20, + "byte": 647 + } + }, + "schema": true, + "symbol": [ + { + "key": "object", + "value": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 5, + "byte": 76 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + } + }, + { + "key": "bar", + "value": { + "environment": "invalid-access", + "begin": { + "line": 35, + "column": 7, + "byte": 634 + }, + "end": { + "line": 35, + "column": 20, + "byte": 647 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 36, + "column": 7, + "byte": 654 + }, + "end": { + "line": 36, + "column": 22, + "byte": 669 + } + }, + "schema": true, + "symbol": [ + { + "key": "myObject", + "value": { + "environment": "invalid-access", + "begin": { + "line": 10, + "column": 5, + "byte": 105 + }, + "end": { + "line": 10, + "column": 13, + "byte": 113 + } + } + }, + { + "key": "bar", + "value": { + "environment": "invalid-access", + "begin": { + "line": 36, + "column": 7, + "byte": 654 + }, + "end": { + "line": 36, + "column": 22, + "byte": 669 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 37, + "column": 7, + "byte": 676 + }, + "end": { + "line": 37, + "column": 24, + "byte": 693 + } + }, + "schema": true, + "symbol": [ + { + "key": "otherObject", + "value": { + "environment": "a", + "begin": { + "line": 5, + "column": 5, + "byte": 50 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + } + }, + { + "index": 0, + "value": { + "environment": "invalid-access", + "begin": { + "line": 37, + "column": 7, + "byte": 676 + }, + "end": { + "line": 37, + "column": 24, + "byte": 693 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 38, + "column": 7, + "byte": 700 + }, + "end": { + "line": 38, + "column": 25, + "byte": 718 + } + }, + "schema": true, + "symbol": [ + { + "key": "open", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "string", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 38, + "column": 7, + "byte": 700 + }, + "end": { + "line": 38, + "column": 25, + "byte": 718 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 39, + "column": 7, + "byte": 725 + }, + "end": { + "line": 39, + "column": 24, + "byte": 742 + } + }, + "schema": true, + "symbol": [ + { + "key": "open", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 39, + "column": 7, + "byte": 725 + }, + "end": { + "line": 39, + "column": 24, + "byte": 742 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 40, + "column": 7, + "byte": 749 + }, + "end": { + "line": 40, + "column": 27, + "byte": 769 + } + }, + "schema": true, + "symbol": [ + { + "key": "open", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "array", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "foo", + "value": { + "environment": "invalid-access", + "begin": { + "line": 40, + "column": 7, + "byte": 749 + }, + "end": { + "line": 40, + "column": 27, + "byte": 769 + } + } + } + ] + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 41, + "column": 7, + "byte": 776 + }, + "end": { + "line": 41, + "column": 24, + "byte": 793 + } + }, + "schema": true, + "symbol": [ + { + "key": "open", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "key": "record", + "value": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + }, + { + "index": 1, + "value": { + "environment": "invalid-access", + "begin": { + "line": 41, + "column": 7, + "byte": 776 + }, + "end": { + "line": 41, + "column": 24, + "byte": 793 + } + } + } + ] + } + ] + }, + "myObject": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 10, + "column": 5, + "byte": 105 + }, + "end": { + "line": 10, + "column": 13, + "byte": 113 + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "object": { + "foo": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 10, + "column": 10, + "byte": 110 + }, + "end": { + "line": 10, + "column": 13, + "byte": 113 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + } + } + }, + "object": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 5, + "byte": 76 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + }, + "schema": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "baz", + "hello" + ] + }, + "base": { + "range": { + "environment": "a", + "begin": { + "line": 3, + "column": 5, + "byte": 22 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + }, + "schema": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + }, + "object": { + "baz": { + "range": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + }, + "schema": { + "type": "string", + "const": "qux" + }, + "literal": "qux" + } + } + }, + "object": { + "hello": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 12, + "byte": 83 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + }, + "schema": { + "type": "string", + "const": "world" + }, + "literal": "world" + } + } + }, + "open": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + }, + "schema": { + "properties": { + "anyOf": { + "type": "string", + "const": "hello" + }, + "array": { + "prefixItems": [ + { + "type": "number", + "const": 2 + }, + { + "type": "string", + "const": "items" + }, + { + "properties": { + "some": { + "type": "string", + "const": "object" + } + }, + "type": "object", + "required": [ + "some" + ] + }, + { + "prefixItems": [ + { + "type": "string", + "const": "array" + } + ], + "items": false, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "boolean": { + "type": "boolean", + "const": true + }, + "false": { + "type": "boolean", + "const": false + }, + "hello": { + "type": "string", + "const": "hello" + }, + "map": { + "properties": { + "blue": { + "type": "number", + "const": 42 + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "blue", + "hello" + ] + }, + "null": { + "type": "null" + }, + "number": { + "type": "number", + "const": 42 + }, + "oneOf": { + "type": "number", + "const": 42 + }, + "pi": { + "type": "number", + "const": 3.14 + }, + "record": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "ref": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + }, + "string": { + "type": "string", + "const": "esc" + }, + "true": { + "type": "boolean", + "const": true + }, + "tuple": { + "prefixItems": [ + { + "type": "string", + "const": "hello" + }, + { + "type": "string", + "const": "world" + } + ], + "items": false, + "type": "array" + } + }, + "type": "object", + "required": [ + "anyOf", + "array", + "boolean", + "false", + "hello", + "map", + "null", + "number", + "oneOf", + "pi", + "record", + "ref", + "string", + "true", + "tuple" + ] + }, + "builtin": { + "name": "fn::open::schema", + "argSchema": { + "$defs": { + "defRecord": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + } + }, + "properties": { + "always": true, + "anyOf": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "type": "" + }, + "array": { + "items": true, + "type": "array" + }, + "boolean": { + "type": "boolean" + }, + "const-array": { + "type": "array", + "const": [ + "hello", + 42 + ] + }, + "const-object": { + "type": "object", + "const": { + "hello": "world" + } + }, + "dependentReq": { + "properties": { + "bar": { + "type": "number" + }, + "foo": { + "type": "string" + } + }, + "type": "object", + "dependentRequired": { + "foo": [ + "bar" + ] + } + }, + "double": { + "prefixItems": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "items": false, + "type": "array" + }, + "enum": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + }, + "exclusiveMaximum": { + "type": "number", + "exclusiveMaximum": 1 + }, + "exclusiveMinimum": { + "type": "number", + "exclusiveMinimum": 1 + }, + "false": { + "type": "boolean", + "const": false + }, + "hello": { + "type": "string", + "const": "hello" + }, + "map": { + "additionalProperties": true, + "type": "object" + }, + "maxItems": { + "type": "array", + "maxItems": 2 + }, + "maxLength": { + "type": "string", + "maxLength": 1 + }, + "maxProperties": { + "type": "object", + "maxProperties": 1 + }, + "maximum": { + "type": "number", + "maximum": 1 + }, + "minItems": { + "type": "array", + "minItems": 3 + }, + "minLength": { + "type": "string", + "minLength": 1 + }, + "minProperties": { + "type": "object", + "minProperties": 1 + }, + "minimum": { + "type": "number", + "minimum": 1 + }, + "multiple": { + "type": "number", + "multipleOf": 2 + }, + "never": false, + "null": { + "type": "null" + }, + "number": { + "type": "number" + }, + "oneOf": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "type": "" + }, + "pattern": { + "type": "string", + "pattern": "^foo[0-9]+$" + }, + "pi": { + "type": "number", + "const": 3.14 + }, + "record": { + "properties": { + "foo": { + "type": "string" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "ref": { + "$ref": "#/$defs/defRecord", + "type": "" + }, + "string": { + "type": "string" + }, + "triple": { + "prefixItems": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ], + "items": false, + "type": "array" + }, + "true": { + "type": "boolean", + "const": true + }, + "tuple": { + "prefixItems": [ + { + "type": "string", + "const": "hello" + }, + { + "type": "string", + "const": "world" + } + ], + "items": false, + "type": "array" + } + }, + "type": "object" + }, + "arg": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 13, + "column": 7, + "byte": 150 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + }, + "schema": { + "properties": { + "anyOf": { + "type": "string", + "const": "hello" + }, + "array": { + "prefixItems": [ + { + "type": "number", + "const": 2 + }, + { + "type": "string", + "const": "items" + }, + { + "properties": { + "some": { + "type": "string", + "const": "object" + } + }, + "type": "object", + "required": [ + "some" + ] + }, + { + "prefixItems": [ + { + "type": "string", + "const": "array" + } + ], + "items": false, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "boolean": { + "type": "boolean", + "const": true + }, + "false": { + "type": "boolean", + "const": false + }, + "hello": { + "type": "string", + "const": "hello" + }, + "map": { + "properties": { + "blue": { + "type": "number", + "const": 42 + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "blue", + "hello" + ] + }, + "null": { + "type": "null" + }, + "number": { + "type": "number", + "const": 42 + }, + "oneOf": { + "type": "number", + "const": 42 + }, + "pi": { + "type": "number", + "const": 3.14 + }, + "record": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "ref": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + }, + "string": { + "type": "string", + "const": "esc" + }, + "true": { + "type": "boolean", + "const": true + }, + "tuple": { + "prefixItems": [ + { + "type": "string", + "const": "hello" + }, + { + "type": "string", + "const": "world" + } + ], + "items": false, + "type": "array" + } + }, + "type": "object", + "required": [ + "anyOf", + "array", + "boolean", + "false", + "hello", + "map", + "null", + "number", + "oneOf", + "pi", + "record", + "ref", + "string", + "true", + "tuple" + ] + }, + "object": { + "anyOf": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 25, + "column": 14, + "byte": 455 + }, + "end": { + "line": 25, + "column": 19, + "byte": 460 + } + }, + "schema": { + "type": "string", + "const": "hello" + }, + "literal": "hello" + }, + "array": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 14, + "byte": 305 + }, + "end": { + "line": 21, + "column": 51, + "byte": 342 + } + }, + "schema": { + "prefixItems": [ + { + "type": "number", + "const": 2 + }, + { + "type": "string", + "const": "items" + }, + { + "properties": { + "some": { + "type": "string", + "const": "object" + } + }, + "type": "object", + "required": [ + "some" + ] + }, + { + "prefixItems": [ + { + "type": "string", + "const": "array" + } + ], + "items": false, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 16, + "byte": 307 + }, + "end": { + "line": 21, + "column": 17, + "byte": 308 + } + }, + "schema": { + "type": "number", + "const": 2 + }, + "literal": 2 + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 19, + "byte": 310 + }, + "end": { + "line": 21, + "column": 24, + "byte": 315 + } + }, + "schema": { + "type": "string", + "const": "items" + }, + "literal": "items" + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 26, + "byte": 317 + }, + "end": { + "line": 21, + "column": 40, + "byte": 331 + } + }, + "schema": { + "properties": { + "some": { + "type": "string", + "const": "object" + } + }, + "type": "object", + "required": [ + "some" + ] + }, + "object": { + "some": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 34, + "byte": 325 + }, + "end": { + "line": 21, + "column": 40, + "byte": 331 + } + }, + "schema": { + "type": "string", + "const": "object" + }, + "literal": "object" + } + } + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 44, + "byte": 335 + }, + "end": { + "line": 21, + "column": 51, + "byte": 342 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "array" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 21, + "column": 46, + "byte": 337 + }, + "end": { + "line": 21, + "column": 51, + "byte": 342 + } + }, + "schema": { + "type": "string", + "const": "array" + }, + "literal": "array" + } + ] + } + ] + }, + "boolean": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 14, + "column": 16, + "byte": 178 + }, + "end": { + "line": 14, + "column": 20, + "byte": 182 + } + }, + "schema": { + "type": "boolean", + "const": true + }, + "literal": true + }, + "false": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 15, + "column": 16, + "byte": 198 + }, + "end": { + "line": 15, + "column": 21, + "byte": 203 + } + }, + "schema": { + "type": "boolean", + "const": false + }, + "literal": false + }, + "hello": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 20, + "column": 14, + "byte": 286 + }, + "end": { + "line": 20, + "column": 19, + "byte": 291 + } + }, + "schema": { + "type": "string", + "const": "hello" + }, + "literal": "hello" + }, + "map": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 23, + "column": 12, + "byte": 388 + }, + "end": { + "line": 23, + "column": 36, + "byte": 412 + } + }, + "schema": { + "properties": { + "blue": { + "type": "number", + "const": 42 + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "blue", + "hello" + ] + }, + "object": { + "blue": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 23, + "column": 34, + "byte": 410 + }, + "end": { + "line": 23, + "column": 36, + "byte": 412 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "literal": 42 + }, + "hello": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 23, + "column": 21, + "byte": 397 + }, + "end": { + "line": 23, + "column": 26, + "byte": 402 + } + }, + "schema": { + "type": "string", + "const": "world" + }, + "literal": "world" + } + } + }, + "null": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 13, + "column": 15, + "byte": 158 + }, + "end": { + "line": 13, + "column": 19, + "byte": 162 + } + }, + "schema": { + "type": "null" + } + }, + "number": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 17, + "column": 15, + "byte": 237 + }, + "end": { + "line": 17, + "column": 17, + "byte": 239 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "literal": 42 + }, + "oneOf": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 26, + "column": 14, + "byte": 474 + }, + "end": { + "line": 26, + "column": 16, + "byte": 476 + } + }, + "schema": { + "type": "number", + "const": 42 + }, + "literal": 42 + }, + "pi": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 18, + "column": 11, + "byte": 250 + }, + "end": { + "line": 18, + "column": 15, + "byte": 254 + } + }, + "schema": { + "type": "number", + "const": 3.14 + }, + "literal": 3.14 + }, + "record": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 24, + "column": 15, + "byte": 429 + }, + "end": { + "line": 24, + "column": 25, + "byte": 439 + } + }, + "schema": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "object": { + "foo": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 24, + "column": 22, + "byte": 436 + }, + "end": { + "line": 24, + "column": 25, + "byte": 439 + } + }, + "schema": { + "type": "string", + "const": "bar" + }, + "literal": "bar" + } + } + }, + "ref": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 27, + "column": 12, + "byte": 488 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + }, + "schema": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + }, + "object": { + "baz": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 27, + "column": 19, + "byte": 495 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + }, + "schema": { + "type": "string", + "const": "qux" + }, + "literal": "qux" + } + } + }, + "string": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 19, + "column": 15, + "byte": 269 + }, + "end": { + "line": 19, + "column": 18, + "byte": 272 + } + }, + "schema": { + "type": "string", + "const": "esc" + }, + "literal": "esc" + }, + "true": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 16, + "column": 15, + "byte": 218 + }, + "end": { + "line": 16, + "column": 19, + "byte": 222 + } + }, + "schema": { + "type": "boolean", + "const": true + }, + "literal": true + }, + "tuple": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 22, + "column": 14, + "byte": 360 + }, + "end": { + "line": 22, + "column": 28, + "byte": 374 + } + }, + "schema": { + "prefixItems": [ + { + "type": "string", + "const": "hello" + }, + { + "type": "string", + "const": "world" + } + ], + "items": false, + "type": "array" + }, + "list": [ + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 22, + "column": 16, + "byte": 362 + }, + "end": { + "line": 22, + "column": 21, + "byte": 367 + } + }, + "schema": { + "type": "string", + "const": "hello" + }, + "literal": "hello" + }, + { + "range": { + "environment": "invalid-access", + "begin": { + "line": 22, + "column": 23, + "byte": 369 + }, + "end": { + "line": 22, + "column": 28, + "byte": 374 + } + }, + "schema": { + "type": "string", + "const": "world" + }, + "literal": "world" + } + ] + } + } + } + } + }, + "string": { + "range": { + "environment": "invalid-access", + "begin": { + "line": 5, + "column": 11, + "byte": 39 + }, + "end": { + "line": 5, + "column": 14, + "byte": 42 + } + }, + "schema": { + "type": "string", + "const": "esc" + }, + "literal": "esc" + } + }, + "properties": { + "array": { + "value": [ + { + "value": 1, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 11, + "byte": 53 + }, + "end": { + "line": 6, + "column": 12, + "byte": 54 + } + } + } + }, + { + "value": 2, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 14, + "byte": 56 + }, + "end": { + "line": 6, + "column": 15, + "byte": 57 + } + } + } + }, + { + "value": 3, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 17, + "byte": 59 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + } + } + ], + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 6, + "column": 10, + "byte": 52 + }, + "end": { + "line": 6, + "column": 18, + "byte": 60 + } + } + } + }, + "errors": { + "value": [ + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 29, + "column": 7, + "byte": 517 + }, + "end": { + "line": 29, + "column": 20, + "byte": 530 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 30, + "column": 7, + "byte": 537 + }, + "end": { + "line": 30, + "column": 19, + "byte": 549 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 31, + "column": 7, + "byte": 556 + }, + "end": { + "line": 31, + "column": 22, + "byte": 571 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 32, + "column": 7, + "byte": 578 + }, + "end": { + "line": 32, + "column": 18, + "byte": 589 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 33, + "column": 7, + "byte": 596 + }, + "end": { + "line": 33, + "column": 19, + "byte": 608 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 34, + "column": 7, + "byte": 615 + }, + "end": { + "line": 34, + "column": 19, + "byte": 627 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 35, + "column": 7, + "byte": 634 + }, + "end": { + "line": 35, + "column": 20, + "byte": 647 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 36, + "column": 7, + "byte": 654 + }, + "end": { + "line": 36, + "column": 22, + "byte": 669 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 37, + "column": 7, + "byte": 676 + }, + "end": { + "line": 37, + "column": 24, + "byte": 693 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 38, + "column": 7, + "byte": 700 + }, + "end": { + "line": 38, + "column": 25, + "byte": 718 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 39, + "column": 7, + "byte": 725 + }, + "end": { + "line": 39, + "column": 24, + "byte": 742 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 40, + "column": 7, + "byte": 749 + }, + "end": { + "line": 40, + "column": 27, + "byte": 769 + } + } + } + }, + { + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 41, + "column": 7, + "byte": 776 + }, + "end": { + "line": 41, + "column": 24, + "byte": 793 + } + } + } + } + ], + "unknown": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 29, + "column": 5, + "byte": 515 + }, + "end": { + "line": 41, + "column": 24, + "byte": 793 + } + } + } + }, + "myObject": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 10, + "column": 10, + "byte": 110 + }, + "end": { + "line": 10, + "column": 13, + "byte": 113 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 10, + "column": 5, + "byte": 105 + }, + "end": { + "line": 10, + "column": 13, + "byte": 113 + } + } + } + }, + "object": { + "value": { + "baz": { + "value": "qux", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + }, + "base": { + "value": "qux", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + } + } + } + } + }, + "hello": { + "value": "world", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 12, + "byte": 83 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 8, + "column": 5, + "byte": 76 + }, + "end": { + "line": 8, + "column": 17, + "byte": 88 + } + }, + "base": { + "value": { + "baz": { + "value": "qux", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + }, + "base": { + "value": "qux", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + } + } + } + } + } + }, + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 5, + "byte": 22 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + }, + "base": { + "value": { + "baz": { + "value": "qux", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 10, + "byte": 27 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + } + } + } + }, + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 3, + "column": 5, + "byte": 22 + }, + "end": { + "line": 3, + "column": 13, + "byte": 30 + } + } + } + } + } + } + } + }, + "open": { + "value": { + "anyOf": { + "value": "hello", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "array": { + "value": [ + { + "value": 2, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + { + "value": "items", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + { + "value": { + "some": { + "value": "object", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + { + "value": [ + { + "value": "array", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + ], + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + ], + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "boolean": { + "value": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "false": { + "value": false, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "hello": { + "value": "hello", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "map": { + "value": { + "blue": { + "value": 42, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "hello": { + "value": "world", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "null": { + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "number": { + "value": 42, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "oneOf": { + "value": 42, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "pi": { + "value": 3.14, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "record": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "ref": { + "value": { + "baz": { + "value": "qux", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "string": { + "value": "esc", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "true": { + "value": true, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "tuple": { + "value": [ + { + "value": "hello", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + { + "value": "world", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + ], + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + } + }, + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 12, + "column": 5, + "byte": 126 + }, + "end": { + "line": 27, + "column": 22, + "byte": 498 + } + } + } + }, + "otherObject": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 5, + "column": 10, + "byte": 55 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + }, + "base": { + "value": "bar", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 5, + "column": 10, + "byte": 55 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + } + } + } + } + } + }, + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 5, + "column": 5, + "byte": 50 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + }, + "base": { + "value": { + "foo": { + "value": "bar", + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 5, + "column": 10, + "byte": 55 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + } + } + } + }, + "trace": { + "def": { + "environment": "a", + "begin": { + "line": 5, + "column": 5, + "byte": 50 + }, + "end": { + "line": 5, + "column": 13, + "byte": 58 + } + } + } + } + } + }, + "string": { + "value": "esc", + "trace": { + "def": { + "environment": "invalid-access", + "begin": { + "line": 5, + "column": 11, + "byte": 39 + }, + "end": { + "line": 5, + "column": 14, + "byte": 42 + } + } + } + } + }, + "schema": { + "properties": { + "array": { + "prefixItems": [ + { + "type": "number", + "const": 1 + }, + { + "type": "number", + "const": 2 + }, + { + "type": "number", + "const": 3 + } + ], + "items": false, + "type": "array" + }, + "errors": { + "prefixItems": [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "items": false, + "type": "array" + }, + "myObject": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "object": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "baz", + "hello" + ] + }, + "open": { + "properties": { + "anyOf": { + "type": "string", + "const": "hello" + }, + "array": { + "prefixItems": [ + { + "type": "number", + "const": 2 + }, + { + "type": "string", + "const": "items" + }, + { + "properties": { + "some": { + "type": "string", + "const": "object" + } + }, + "type": "object", + "required": [ + "some" + ] + }, + { + "prefixItems": [ + { + "type": "string", + "const": "array" + } + ], + "items": false, + "type": "array" + } + ], + "items": false, + "type": "array" + }, + "boolean": { + "type": "boolean", + "const": true + }, + "false": { + "type": "boolean", + "const": false + }, + "hello": { + "type": "string", + "const": "hello" + }, + "map": { + "properties": { + "blue": { + "type": "number", + "const": 42 + }, + "hello": { + "type": "string", + "const": "world" + } + }, + "type": "object", + "required": [ + "blue", + "hello" + ] + }, + "null": { + "type": "null" + }, + "number": { + "type": "number", + "const": 42 + }, + "oneOf": { + "type": "number", + "const": 42 + }, + "pi": { + "type": "number", + "const": 3.14 + }, + "record": { + "properties": { + "foo": { + "type": "string", + "const": "bar" + } + }, + "type": "object", + "required": [ + "foo" + ] + }, + "ref": { + "properties": { + "baz": { + "type": "string", + "const": "qux" + } + }, + "type": "object", + "required": [ + "baz" + ] + }, + "string": { + "type": "string", + "const": "esc" + }, + "true": { + "type": "boolean", + "const": true + }, + "tuple": { + "prefixItems": [ + { + "type": "string", + "const": "hello" + }, + { + "type": "string", + "const": "world" + } + ], + "items": false, + "type": "array" + } + }, + "type": "object", + "required": [ + "anyOf", + "array", + "boolean", + "false", + "hello", + "map", + "null", + "number", + "oneOf", + "pi", + "record", + "ref", + "string", + "true", + "tuple" + ] + }, + "string": { + "type": "string", + "const": "esc" + } + }, + "type": "object", + "required": [ + "array", + "errors", + "myObject", + "object", + "open", + "string" + ] + } + } +} \ No newline at end of file