Rx knows any.of for subschemas, and feature request #10 on the Kwalify sourceforge suggests an implementation.
This would be a great feature to have for cases where, e.g., a data set will have a type, and this type only allows for a certain subset of keys to be used.
type: vehicle-factory
products:
- type: car
doors: 4
wheels: 4
- type: vanette
doors: 5
wheels: 4
- type: motorcycle
handle: steel
wheels: 2
In this (arguably not very clever) example, cars can have doors, so can vanettes. motorcycles cannot have doors, but can have handles made from a specific material. Both the other vehicle types cannot have handles, but all vehicles can have wheels, etc.
This feature would allow for much stricter schemas to be implemented and validated, and I think would be of great use to many users.
Rx knows
any.offor subschemas, and feature request #10 on the Kwalify sourceforge suggests an implementation.This would be a great feature to have for cases where, e.g., a data set will have a type, and this type only allows for a certain subset of keys to be used.
In this (arguably not very clever) example,
cars can havedoors, so canvanettes.motorcyclescannot havedoors, but can havehandles made from a specific material. Both the other vehicle types cannot havehandles, but all vehicles can havewheels, etc.This feature would allow for much stricter schemas to be implemented and validated, and I think would be of great use to many users.