-
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
Questions on @internal
, @tags
, and enum values
#1737
Comments
|
Thanks for the prompt reply!
This is technically correct, but said model transform is part of the core Smithy library, which all code generators should apply, provided as So the end-user reading the documentation will just see them as equivalent when synthesizing their IDL v1 model. |
We have revisited the changes made related to this. Answering your questions below with related changes we plan to make.
In general, no. But since we can't use
Kind of. Depends on the context of the end-user, like if you are in the context of transforming the string enum to enum shape. We will update the javadocs on the related transform/codegen classes. We are also missing docs on this transform here which we will fix. We will add some clarification to the enum trait docs for this. Based on these, in regards to the protocol tests referenced, we will change them so that:
|
Thanks! That makes sense. One last question. We have a rather old PR open in smithy-rs to migrate entirely to
would always be "yes" to the eyes of a smithy-rs user by virtue of how the transform works. |
I don't think this discussion changes the recommendation to apply the |
Closing as this discussion seems resolved and 1.31.0 contains the latest updates to enum upgrades. |
I think the following two PRs introduce behavior that is not documented well:
These prompted the following questions.
1. Should
@internal
shapes automatically be filtered out by all tooling?The documentation for the
@internal
trait reads:(emphasis mine)
#1658 adds a protocol test to exclude returning enum values that have been marked with the @internal trait.
However, my reading of the documentation is that
@internal
is just a marker trait that carries no semantics — it is up to tooling to decide whether to filter out@internal
-tagged shapes or not. Therefore, I would have expected that the user first needs to define a projection that explicitly filtered out@internal
shapes for a server SDK to be built that would pass that protocol test; if the@internal
shapes are not filtered out, then a server SDK should still include them in the validation error message.2. Does
@tags["internal"]
imply@internal
?Both PRs above add tests such that enum values tagged (i.e. using the
@tags
trait or thetags
property on the@enum
trait) with the string"internal"
are not included in the validation error message.This seems to imply that
@tags["internal"]
implies@internal
. However, I don't see this documented. I was under the impression that tags for a shape lived in a completely separate data plane that would not interact with that of Smithy traits, and that they would just boil down to a bag of string values whose meaning is entirely for user-defined tooling to decide.3. Does the
tags
property on the@enum
trait imply@tags
?The answer to this is obviously yes, but I think that the docs for the property:
could be clearer, perhaps by having the word
tags
link to the trait@tags
. As written, one could interpret the tags for an enum value to be completely independent of those defined using@tags
.The text was updated successfully, but these errors were encountered: