I am suggesting to extend the existing "any" type to handle a new
"of" attribute. This would hold a sequence of subschemas; it is
sufficient that any of the subschemas validates.
This is a generic approach to implement the feature request
described in
http://sourceforge.net/tracker/?func=detail&aid=3033032&group_id=144532&atid=759041
As the author of the Kwalify.pm Perl module, it seems to me that
the implementation is not that hard, maybe about 20 lines of
additional code, most of it just for error checks:
- the value of the "of" attribute should be a non-empty list,
otherwise the schema should be invalid
The implementation could be as following: iterate over all
subschemas. Turn error/exception throwing off, if necessary. If
the subschema validates, then we're done. If none of the
subschemas validates, then throw a validation error.
As a side node, the other data schema language I am aware of, Rx,
already has "any.of" implemented. See
http://rx.codesimply.com/coretypes.html
+1