mirror of https://github.com/smithy-lang/smithy-rs
345624eb6c
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> Previously, there was logic used to ignore the default 0/false values for numbers/booleans when serializing members if they weren't boxed. This was to fix issues that occured when upstream models didn't properly box shapes that were meant to be optional, and for the most part worked because services would just fill in the default if it wasn't passed. However, with Smithy 2.0, models may have defaults != 0/false, but the codegenerator still ignores the zero value. ## Description <!--- Describe your changes in detail --> This commit makes it so that the actual default value for the member is ignored for booleans and numbers, instead of just 0/false. It also updates serialization for http bindings so that headers and query parameters with 0/false values aren't ignored if they are optional parameters. ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> - [x] Generated AWS SDK and inspected diff. Only changes are not ignoring default value inside `if let Some() = ...` blocks, and ignoring default value instead of just 0 (only seems to effect nimble). - [x] Added protocol tests for serializing 0/false in query params for restXml and restJson ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <john@vinylsquid.com> |
||
---|---|---|
.. | ||
basic-enums.smithy | ||
dynamodb.json | ||
endpoint-rules.smithy | ||
error-correction-nullability-test.smithy | ||
main.smithy | ||
more-nesting.smithy | ||
nested.smithy | ||
rest-xml-extras.smithy | ||
rest-xml-unwrapped-errors.smithy |