Skip to content

Commit 8010e0d

Browse files
committed
minor improvement to vdom schema
1 parent 68d3b28 commit 8010e0d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

idom/core/vdom.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@
4646
"properties": {
4747
"source": {"type": "string"},
4848
"fallback": {
49+
"type": ["object", "string", "null"],
4950
"if": {"not": {"type": "null"}},
5051
"then": {"$ref": "#/definitions/elementOrString"},
5152
},
5253
},
5354
"required": ["source"],
5455
},
5556
"elementOrString": {
56-
"if": {"not": {"type": "string"}},
57+
"type": ["object", "string"],
58+
"if": {"type": "object"},
5759
"then": {"$ref": "#/definitions/element"},
5860
},
5961
},

tests/test_core/test_vdom.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def test_valid_vdom(value):
235235
r"data must be array",
236236
),
237237
(
238-
{"tagName": "tag", "children": [0]},
239-
r"data must be object",
238+
{"tagName": "tag", "children": [None]},
239+
r"data must be object or string",
240240
),
241241
(
242242
{"tagName": "tag", "children": [{"tagName": None}]},
@@ -298,7 +298,7 @@ def test_valid_vdom(value):
298298
"tagName": "tag",
299299
"importSource": {"source": "something", "fallback": 0},
300300
},
301-
r"data must be object",
301+
r"data\.fallback must be object or string or null",
302302
),
303303
(
304304
{

0 commit comments

Comments
 (0)