We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Generating a code for the following trait:
@trait structure someTrait { @idRef(failWhenMissing: true) targetId: String }
renders the following java code:
/** * Creates a builder used to build a {@link SomeTrait}. */ public SmithyBuilder<SomeTrait> toBuilder() { return builder().sourceLocation(getSourceLocation()) .targetId(targetId); } public static Builder builder() { return new Builder(); } /** * Builder for {@link SomeTrait}. */ public static final class Builder extends AbstractTraitBuilder<SomeTrait, Builder> {private ShapeId targetId; private Builder() {} public Builder targetId(String targetId) { this.targetId = targetId; return this; } @Override public SomeTrait build() { return new SomeTrait(this); } }
which doesn't compile, it attempts to assign a String into a ShapeId field
String
ShapeId
The text was updated successfully, but these errors were encountered:
Definitely a bug, this has to do with the idref on a member incorrectly assuming the target is already an idref.
You can work around this for now by applying the @idref to a standalone shape like: https://github.com/smithy-lang/smithy/blob/main/smithy-trait-codegen/src/test/resources/META-INF/smithy/idref/idref-struct-with-nested-refs.smithy
@idref
Sorry, something went wrong.
No branches or pull requests
Generating a code for the following trait:
renders the following java code:
which doesn't compile, it attempts to assign a
String
into aShapeId
fieldThe text was updated successfully, but these errors were encountered: