We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c6ed18 commit 72023e6Copy full SHA for 72023e6
encoding/jsonschema/testdata/txtar/ifthenelse.txtar
@@ -0,0 +1,36 @@
1
+-- schema.json --
2
+{
3
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
4
+ "if": {
5
+ "properties": {
6
+ "a": {
7
+ "type": "number"
8
+ }
9
+ },
10
+ "required": [
11
+ "a"
12
+ ]
13
14
+ "then": {
15
16
+ "b": {
17
18
19
20
21
+ "b"
22
23
24
+ "type": "object"
25
+}
26
+-- out/decode/extract --
27
+@jsonschema(schema="https://json-schema.org/draft/2019-09/schema")
28
+matchIf(null | bool | number | string | [...] | {
29
+ a!: number
30
+ ...
31
+}, null | bool | number | string | [...] | {
32
+ b!: number
33
34
+}, _) & {
35
36
0 commit comments