Skip to content

Fix issue with smithy union serialization in multiple protocols #4308

@landonxjames

Description

@landonxjames

#4306 fixes a bug in XmlBindingTraitSerializerGenerator.kt exposed by a change to the S3-Control model .
The model change introduced a smithy union type that contained a unit struct as a member. This generated a match arm like:

crate::types::ObjectEncryptionFilter::Sses3(inner) =>
{
    scope_writer.start_el("SSE-S3").finish();
}

inner is never used since there is nothing to serialize for a unit struct, so this caused a warning and CI failure.

A quick review of other ${protocol}SerializerGenerator classes shows that they likely also contain the same bug:

We should fix this for all of our protocols and add some codegen tests for it (the updated S3-control model implicitly tests it for XML, but explicit tests would be better).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions