Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement any.of #112

Open
sdruskat opened this issue Sep 29, 2017 · 2 comments
Open

Implement any.of #112

sdruskat opened this issue Sep 29, 2017 · 2 comments

Comments

@sdruskat
Copy link

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.

@Grokzen
Copy link
Owner

Grokzen commented Mar 6, 2018

@sdruskat I do see the potential of this but i am afraid it will be a major feature and not sure when i can put the time in to finish developing it tho. I probably want it in, but can't make any promises on when.

@sdruskat
Copy link
Author

sdruskat commented Mar 7, 2018

I'd like to help if I can, but - same as you - I can't say when I'd have the time right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants