Skip to content

Commit 172973d

Browse files
committed
Switch to if/then style for context properties
... to provide better error-reporting when using general-purpose JSON Schema validators.
1 parent d94c543 commit 172973d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

schemas/program/context.schema.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ description: |
88
99
type: object
1010

11-
anyOf:
12-
- $ref: "schema:ethdebug/format/program/context/code"
13-
- $ref: "schema:ethdebug/format/program/context/variables"
14-
- $ref: "schema:ethdebug/format/program/context/remark"
11+
allOf:
12+
- if:
13+
required: ["code"]
14+
then:
15+
$ref: "schema:ethdebug/format/program/context/code"
16+
- if:
17+
required: ["variables"]
18+
then:
19+
$ref: "schema:ethdebug/format/program/context/variables"
20+
- if:
21+
required: ["remark"]
22+
then:
23+
$ref: "schema:ethdebug/format/program/context/remark"
1524

1625
unevaluatedProperties: false
1726

0 commit comments

Comments
 (0)