Skip to content

Commit 0a8e231

Browse files
committed
Fix snapshot tests
1 parent 664b79e commit 0a8e231

File tree

1 file changed

+60
-49
lines changed

1 file changed

+60
-49
lines changed

packages/cw-schema/tests/snapshots/basic__snapshot_jsonschema.snap

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,11 @@ expression: schema
1212
"type": {
1313
"type": "string",
1414
"const": "v1"
15-
},
16-
"root": {
17-
"type": "integer",
18-
"format": "uint",
19-
"minimum": 0
20-
},
21-
"definitions": {
22-
"type": "array",
23-
"items": {
24-
"$ref": "#/$defs/Node"
25-
}
2615
}
2716
},
17+
"$ref": "#/$defs/SchemaV1",
2818
"required": [
29-
"type",
30-
"root",
31-
"definitions"
19+
"type"
3220
]
3321
}
3422
],
@@ -297,41 +285,7 @@ expression: schema
297285
"const": "struct"
298286
}
299287
},
300-
"anyOf": [
301-
{
302-
"type": "null"
303-
},
304-
{
305-
"type": "object",
306-
"properties": {
307-
"properties": {
308-
"type": "object",
309-
"additionalProperties": {
310-
"$ref": "#/$defs/StructProperty"
311-
}
312-
}
313-
},
314-
"required": [
315-
"properties"
316-
]
317-
},
318-
{
319-
"type": "object",
320-
"properties": {
321-
"items": {
322-
"type": "array",
323-
"items": {
324-
"type": "integer",
325-
"format": "uint",
326-
"minimum": 0
327-
}
328-
}
329-
},
330-
"required": [
331-
"items"
332-
]
333-
}
334-
],
288+
"$ref": "#/$defs/StructType",
335289
"required": [
336290
"type"
337291
]
@@ -445,6 +399,26 @@ expression: schema
445399
"name"
446400
]
447401
},
402+
"SchemaV1": {
403+
"type": "object",
404+
"properties": {
405+
"root": {
406+
"type": "integer",
407+
"format": "uint",
408+
"minimum": 0
409+
},
410+
"definitions": {
411+
"type": "array",
412+
"items": {
413+
"$ref": "#/$defs/Node"
414+
}
415+
}
416+
},
417+
"required": [
418+
"root",
419+
"definitions"
420+
]
421+
},
448422
"StructProperty": {
449423
"type": "object",
450424
"properties": {
@@ -463,6 +437,43 @@ expression: schema
463437
"required": [
464438
"value"
465439
]
440+
},
441+
"StructType": {
442+
"anyOf": [
443+
{
444+
"type": "null"
445+
},
446+
{
447+
"type": "object",
448+
"properties": {
449+
"properties": {
450+
"type": "object",
451+
"additionalProperties": {
452+
"$ref": "#/$defs/StructProperty"
453+
}
454+
}
455+
},
456+
"required": [
457+
"properties"
458+
]
459+
},
460+
{
461+
"type": "object",
462+
"properties": {
463+
"items": {
464+
"type": "array",
465+
"items": {
466+
"type": "integer",
467+
"format": "uint",
468+
"minimum": 0
469+
}
470+
}
471+
},
472+
"required": [
473+
"items"
474+
]
475+
}
476+
]
466477
}
467478
}
468479
}

0 commit comments

Comments
 (0)