Leaf element data type to be either type-a or type-b

Hello,

did you try to use union type?
https://tools.ietf.org/html/rfc7950#section-9.12