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

Dynamic validation based on keys in data (internal reference) #253

Open
idantene opened this issue Oct 31, 2024 · 0 comments
Open

Dynamic validation based on keys in data (internal reference) #253

idantene opened this issue Oct 31, 2024 · 0 comments

Comments

@idantene
Copy link
Contributor

idantene commented Oct 31, 2024

Hey,

I have a thought for dynamic schema validation that I think is currently lacking (perhaps not too common request, though I believe it can be implemented as another validator).

In this case, I have a data YAML file where a mapping is expected. The keys may be anything the user decides, and the values are according to some predefined schema - so far, so good.

Next, at a later part in the data YAML, some other mapping occurs. Here, the value of the mapping has to relate to the keys defined earlier.

For example (a data YAML):

metrics:
  iou:  # this can be whatever the user chooses
    name: foo
    unit: bar
    direction: up
...
results:
  - name: something
    metric: iou  # this has to be one of the keys defined under `metrics` above
    value: 59
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

1 participant