Closed mjc3bb closed 4 months ago
seems like either a parsing bug or a service side bug. We're investigating and will get this fixed
Bug on our side. Fixed here: https://github.com/smithy-lang/smithy-rs/pull/3481 It just missed the train for the new release of the code generator but it will go out in the next one or a patch.
Thanks so much for the quick response and fix on this!
Hi, just wanted to follow up on this issue. It wasn't high priority at the time I submitted this issue but it is starting to become a blocker for a project at work. I don't see a listed cadence, is there any expected timeline for a new release to be cut for smithy-rs so that this change can make it into aws-sdk-rust?
Edit: I see now the changes actually are in next
, so hopefully that means we can expect a release with those changes relatively soon?
The fix was merged into smithy-rs, so it'll go out the next time we do a smithy-rs release, which should be pretty soon.
Confirmed the reproduction steps were executed successfully with aws-sdk-quicksight
of version 1.26.0 (must've been fixed in an earlier version).
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
In aws-models/quicksight.json DataSourceParameters has the union type, but the api appears to return a structure type with nulls for the other variants. Due to this, when calling aws_sdk_quicksight::Client::list_data_sources() it errors due to AmazonElasticsearchParameters being returned as null.
Expected Behavior
Calling aws_sdk_quicksight::Client::list_data_sources() should correctly parse the returned api response and provide a single enum variant of DataSourceParameters.
Current Behavior
The api appears to return a structure type instead of a union type, so it has a null value for all possible variants, except the variant it actually is. The generated code bounces off of the first variant check which is AmazonElasticsearchParameters.
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/quicksight/src/protocol_serde/shape_data_source_parameters.rs#L195
body of datasourceparameters from the trace logs:
stdout from test to reproduce issue
Reproduction Steps
resp will be a service error about failing to parse json.
Possible Solution
A quick fix that I validated works is to use a structure type instead of a union type in the aws-model, like boto3 does. This severely limits the usability of the type however since you can no longer match against it to determine which DataSourceParameters variant it used. It's possible this is more of a QuickSight api problem, as it returns surprising/unexpected data.
Additional Information/Context
No response
Version