4545 "properties" : {
4646 "tagName" : {"type" : "string" },
4747 "key" : {"type" : "string" },
48+ "error" : {"type" : "string" },
4849 "children" : {"$ref" : "#/definitions/elementChildren" },
4950 "attributes" : {"type" : "object" },
5051 "eventHandlers" : {"$ref" : "#/definitions/elementEventHandlers" },
5152 "importSource" : {"$ref" : "#/definitions/importSource" },
5253 },
54+ # The 'tagName' is required because its presence is a useful indicator of
55+ # whether a dictionary describes a VDOM model or not.
5356 "required" : ["tagName" ],
57+ "dependentSchemas" : {
58+ # When 'error' is given, the 'tagName' should be empty.
59+ "error" : {"properties" : {"tagName" : {"maxLength" : 0 }}}
60+ },
5461 },
5562 "elementChildren" : {
5663 "type" : "array" ,
@@ -315,9 +322,9 @@ def _is_single_child(value: Any) -> bool:
315322
316323
317324class _VdomDictOptional (TypedDict , total = False ):
318- key : str # noqa
319- children : Sequence [Any ] # noqa
320- attributes : Dict [str , Any ] # noqa
325+ key : str
326+ children : Sequence [Any ]
327+ attributes : Dict [str , Any ]
321328 eventHandlers : EventHandlerDict # noqa
322329 importSource : ImportSourceDict # noqa
323330
@@ -338,9 +345,10 @@ class ImportSourceDict(TypedDict):
338345
339346
340347class _OptionalVdomJson (TypedDict , total = False ):
341- key : str # noqa
342- children : List [Any ] # noqa
343- attributes : Dict [str , Any ] # noqa
348+ key : str
349+ error : str
350+ children : List [Any ]
351+ attributes : Dict [str , Any ]
344352 eventHandlers : Dict [str , _JsonEventTarget ] # noqa
345353 importSource : _JsonImportSource # noqa
346354
0 commit comments