-
Notifications
You must be signed in to change notification settings - Fork 211
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
Selectors: recursive mixin check? #2228
Comments
Maybe we could add a synthetic “transitiveMixin” relationship available to selectors which includes direct and transitive mixins. Or maybe a :hasMixin(a, c, c) function that returns true if all mixins are present on a shape. I like the relationship but we’d need to see how disruptive it is vs a function. |
I pushed up a branch that has a proof of concept for If you wanna try it out, you could pull this down and then build the Smithy CLI using
|
Thank you! |
Hi! I was wondering if there's a way to write a selector that checks if the given shape has a mixin... but checking recursively.
For example, consider this model:
In its current state, it's valid. However, if you uncomment
Indirect
it no longer matches (it inherits thehasMyMixin
trait, but that fails to validate onIndirect
due to the mixin being transitive).Would it make sense to expand the
mixin
relationship, or provide a recursive variant of-[...]->
? Perhaps a "forward directed recursive neighbor" syntax, like-[...]~>
?Is there a better, existing way to do what I'm looking for? (without resorting to Java)
The text was updated successfully, but these errors were encountered: