-
Notifications
You must be signed in to change notification settings - Fork 218
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
Enforcing @private on trait usage #1369
Comments
Yeah, private is supposed to not allow referencing private traits outside of the defined namespace. It's a bug if that's not the behavior now. |
Upon looking into this further, there are other cases that exhibit this behavior as well. This example includes everything that seems to not enforce
Based on the documentation, I'm not sure if 3. is expected behavior, because while the mixin itself isn't private, the member being referenced is. Both 1. and 2. are clearly references to private shapes in another namespace though. For 1., we could use
Unless I'm missing something, we would probably have to model these target elision relationships in order to fix 2. and possibly 3. If I'm not missing something, we might want to open a separate issue for that because it would be a more general change. In the meantime I think a solution to this specific problem would be to just check any applied traits to the shape and see if they're private. |
Should referencing a
@private
trait be permitted outside the declared namespace?I couldn't really tell from https://awslabs.github.io/smithy/1.0/spec/core/constraint-traits.html#private-trait.
And it looks like the private access validator isn't including trait relationships (and so allows you to use it wherever).
Example
and no complaints during build.
Main reason I'm asking is because HttpConfiguration
doesn't add
private
to localTraits, so all of the mixed protocols now end up being@private
too.Didn't know if this was intentional, so wanted to get a better understanding of what
@private
is supposed to do.No real issue here, just curious. :)
The text was updated successfully, but these errors were encountered: