Skip to content

fix: always serialize defaults #1302

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix: always serialize defaults #1302

wants to merge 2 commits into from

Conversation

ianbotsf
Copy link
Contributor

Issue #

Resolves awslabs/aws-sdk-kotlin#1608

Description of changes

This change switches the default serialization mode from WHEN_DIFFERENT (meaning only if the value has been changed from the default) to ALWAYS (meaning...well, always). This is the current recommendation from Smithy and will offer more deterministic communication with services.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf requested a review from a team as a code owner June 20, 2025 20:49
Copy link

Affected Artifacts

No artifacts changed size

@@ -173,7 +173,7 @@ fun Model.defaultSettings(
sdkId: String = TestModelDefault.SDK_ID,
generateDefaultBuildFiles: Boolean = false,
nullabilityCheckMode: CheckMode = CheckMode.CLIENT_CAREFUL,
defaultValueSerializationMode: DefaultValueSerializationMode = DefaultValueSerializationMode.WHEN_DIFFERENT,
defaultValueSerializationMode: DefaultValueSerializationMode = DefaultValueSerializationMode.DEFAULT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally set to WHEN_DIFFERENT because serializing defaults caused problems with S3, can we double-check those model issues are now resolved?

Comment on lines +276 to +277
requireNotNull(entries.find { it.value.equals(value, ignoreCase = true) }) {
"$value is not a valid DefaultValueSerializationMode, expected one of ${values().map { it.value }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this comparison need to change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these tests were updated to use the previous value WHEN_DIFFERENT. Do we have tests for the new value ALWAYS?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloudfront update behavior issue
3 participants