Skip to content
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

Bump smithy version to 1.52 #3887

Merged
merged 14 commits into from
Oct 24, 2024
Merged

Bump smithy version to 1.52 #3887

merged 14 commits into from
Oct 24, 2024

Conversation

landonxjames
Copy link
Contributor

@landonxjames landonxjames commented Oct 18, 2024

Motivation and Context

Bumping smithy to 1.52 for an httpChecksum trait bugfix

A few fixes had to be made to protocol tests for this release:

  • Update document to initialize as empty {} instead of null
  • Update our header serialization to serialize present but empty headers to "" (Note that this change does not apply to server header serialization)
  • Add accept: application/cbor header to add rpcV2Cbor requests
  • Skip two broken tests. These tests were fixed in Fix name of XML root nodes in tests smithy#2423 and that change was included in the 1.52 release notes, but the actual change did not make it into the build artifact. The changes should make it into the 1.52.1 release in the next few days: Bump version to 1.52.1 smithy#2428

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@landonxjames landonxjames force-pushed the landonxjames/smithy152 branch from 2a7b98b to 14ae7dd Compare October 20, 2024 04:40
@landonxjames landonxjames force-pushed the landonxjames/smithy152 branch from 81198f9 to d43e580 Compare October 20, 2024 21:15
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 20, 2024
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 20, 2024
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 20, 2024
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 20, 2024
@landonxjames landonxjames force-pushed the landonxjames/smithy152 branch from f42809f to 423c8ba Compare October 20, 2024 21:44
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames force-pushed the landonxjames/smithy152 branch from 46e5dd2 to 7657f1b Compare October 20, 2024 23:14
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@landonxjames landonxjames marked this pull request as ready for review October 22, 2024 20:55
@landonxjames landonxjames requested review from a team as code owners October 22, 2024 20:55
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Comment on lines +632 to +636
// Empty vec in header is serialized as an empty string
if ${context.valueExpression.name}.is_empty() {
builder = builder.header("$headerName", "");
} else {""",
"}", conditional = serializeEmptyHeaders,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@@ -91,7 +91,7 @@ class RequestBindingGenerator(
*/
fun renderUpdateHttpBuilder(implBlockWriter: RustWriter) {
uriBase(implBlockWriter)
val addHeadersFn = httpBindingGenerator.generateAddHeadersFn(operationShape)
val addHeadersFn = httpBindingGenerator.generateAddHeadersFn(operationShape, serializeEmptyHeaders = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this only affect clients?

Copy link
Contributor Author

@landonxjames landonxjames Oct 24, 2024

Choose a reason for hiding this comment

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

The updated tests for this only apply to clients: https://github.com/smithy-lang/smithy/pull/2403/files

There are similar tests for the server, but they still indicate that empty headers should not be serialized by the server: https://github.com/smithy-lang/smithy/blob/main/smithy-aws-protocol-tests/model/restJson1/http-headers.smithy#L455

I asked internally about this discrepancy and there didn't seem to be much of a reason for it, so it might be updated in the future to align the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a PR to smithy to update the server tests to align: smithy-lang/smithy#2433

@landonxjames landonxjames added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit 8d8e7ab Oct 24, 2024
44 checks passed
@landonxjames landonxjames deleted the landonxjames/smithy152 branch October 24, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants