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

Add support for storing more complex validations in definitions #870

Open
shirshendu opened this issue Mar 15, 2018 · 0 comments
Open

Add support for storing more complex validations in definitions #870

shirshendu opened this issue Mar 15, 2018 · 0 comments

Comments

@shirshendu
Copy link

Currently in

:
an attribute would have a help and a type.

        volume_profiling_flag:
          help: Whether to enable/disable/leave as-is volume profiling
          type: String

Let us start adding support for more complex validations, possibly under a validations key.
For example, in the above example, we should have the volume_profiling_flag attribute as a String, as well as one-of-n values.

How about something like this:

        volume_profiling_flag:
          help: Whether to enable/disable/leave as-is volume profiling
          type: String
          validations:
            type: String
            inclusion:
              - enable
              - disable
              - 'leave-as-is'            

It is up for discussion if we want to repeat the type: String in the validation as well. I would suggest being explicit, because we may have an attribute that needs to be casted if present, but not validated.

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