I want to specify a type called Item
which has the possibility of being nested as follows:
Either
type Item {
...;
item: Item;
answer: {
...;
//(does not contain property "item")
}
}
OR
type Item {
...;
//(does not contain property "item")
answer: {
...;
item: Item
}
}
i.e. either the Item
type can have item:Item
as a direct child property, or as a grandchild below the property answer
but not both.
Context: I'm trying to implement the item property of the QuestionnaireResponse resource from the FHIR specification