-
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
Missing smithy-trait-codegen union support #2268
Comments
We do have plans to add support for union traits in a future release. |
Will this include traits to support untagged and discriminated unions? |
The support for union traits mentioned here is for generating the java implementation of custom Smithy Union traits such as:
I was not referring to adding additional behavior traits to modify the behavior of Smithy unions. Support for union trait generation will not include anything relating to untagged unions. |
@hpmellema Will it also support the following case? @trait
structure MyTrait {
union: MyUnion
}
union MyUnion {
option1: String
option2: Integer
} During decoding, it would work only for tagged unions, right? For example: @MyTrait(
union: {
option1: "Foo"
}
}
structure StructWithTrait {}
|
Yes, we plan to support nested unions within trait definitions, and yes, on node deserialization only tagged unions would be supported. |
We're using the new smithy-trait-codegen module to generate the java trait files for the protocols. Seem that the unions are not supported yet
smithy/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenSymbolProvider.java
Line 184 in 1805e51
Is it something on the radar for the upcoming releases? If not, would contribution speed up the process?
Thanks
The text was updated successfully, but these errors were encountered: