xsdata
xsdata copied to clipboard
Type annotations for compound fields don't address token elements
The new type annotations for compound fields can generate this
@dataclass
class Node:
class Meta:
name = "node"
node_or_id: List[Union["Node", str]] = field(
default_factory=list,
metadata={
"type": "Elements",
"choices": (
{
"name": "node",
"type": Type["Node"],
},
{
"name": "id",
"type": List[str],
"default_factory": list,
"tokens": True,
},
),
},
)
It should be node_or_id: List[Union["Node", List[str]]