appears 5 times get-response.xsd. This causes Java's XJC (I guess code generators of other type-safe languages would behave similarly) to create 5 different classes, as all of them are technically different anonymous inner types. Though, all of them only contain a List<Component>.
Having those 5 different types makes handling them in code needlessly cumbersome and error prone, as each code written to be applied on all of them needs to be written 5 times.
The following hunk of code:
appears 5 times
get-response.xsd
. This causes Java's XJC (I guess code generators of other type-safe languages would behave similarly) to create 5 different classes, as all of them are technically different anonymous inner types. Though, all of them only contain aList<Component>
.Having those 5 different types makes handling them in code needlessly cumbersome and error prone, as each code written to be applied on all of them needs to be written 5 times.
I would hence suggest to introduce
and use it as e.g.
<xs:element name="components-studied" type="ComponentList" minOccurs="0" maxOccurs="1">
As far as I can tell this would NEITHER change the XML's syntax, NOR its semantic.