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

Validate mutually exclusive traits #64

Open
Tracked by #77
feltech opened this issue Nov 28, 2023 · 0 comments
Open
Tracked by #77

Validate mutually exclusive traits #64

feltech opened this issue Nov 28, 2023 · 0 comments
Milestone

Comments

@feltech
Copy link
Member

feltech commented Nov 28, 2023

What

Investigate adding an optional property to the YAML schema for traits, for calling out other traits that are mutually exclusive to this one, and so should not appear in the same trait set.

If possible, validate at generation time that specifications do not violate this condition, and validate that mutually exclusive lists are consistent with one-another.

Why

The absence of a trait from a trait set does not mean the negation of that trait. In order to represent negation, we need a separate trait to represent the alternative.

Such opposite pairs of traits should clearly not be allowed together in the same trait set.

It is also not always clear at a glance what the "negative trait" for a given trait is.

More generally, there may be arbitrarily large subsets of traits, elements of which should never appear together in the same entity trait set (or specification).

So from both a validation and a documentation perspective, having a structured way to describe mutually exclusive groups of traits is valuable.

Notes

Cross-package mutually-exclusive traits present a difficulty for validation. So we can either skip validating these, or revisit the idea of requiring the .yml of dependencies during generation.

@foundrytom foundrytom changed the title Add "mutually exclusive" YAML property to schema [Investigation] How to communicate mutually exclusive traits Dec 11, 2023
@elliotcmorris elliotcmorris changed the title [Investigation] How to communicate mutually exclusive traits Validate mutually exclusive traits Apr 19, 2024
@elliotcmorris elliotcmorris added this to the v1.0.0 milestone Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants