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

feat!: XML response deserialization #1299

Merged
merged 40 commits into from
Feb 10, 2024
Merged

feat!: XML response deserialization #1299

merged 40 commits into from
Feb 10, 2024

Conversation

jbelkins
Copy link
Contributor

@jbelkins jbelkins commented Jan 11, 2024

Issue #

#964

Description of changes

Uses a new first-party system for deserializing XML responses and errors, replacing the XMLCoder third-party Swift coder for XML.

  • Remove tests from AWSClientRuntimeTests that were just copied from protocol tests
  • SerdeContext is unused, and is removed
  • AWSHttpRequestXMLEncoder and AWSHttpResponseXMLDecoder are removed, since XML no longer uses decoders

Also:

  • Replace the .getOrNull() "syntactic sugar" method for converting Java optional to Kotlin nullable with Kotlin built-in .orElse(null)

New/existing dependencies impact assessment, if applicable

No new dependencies were added to this change. The XMLCoder third-party Swift package is removed.

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

Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Mostly questions with couple requested changes

Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

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

Lgtm

@jbelkins jbelkins merged commit 368026e into main Feb 10, 2024
17 checks passed
@jbelkins jbelkins deleted the jbe/xml_reader branch February 10, 2024 17:58
@@ -56,14 +62,36 @@ class S3ErrorIntegration : SwiftIntegration {
private val httpResponseBinding = SectionWriter { writer, _ ->
val ctx = writer.getContext("ctx") as ProtocolGenerator.GenerationContext
val errorShapes = writer.getContext("errorShapes") as List<StructureShape>
writer.write("let restXMLError = try await \$N.makeError(from: httpResponse)", AWSClientRuntimeTypes.RestXML.RestXMLError)
Copy link
Member

Choose a reason for hiding this comment

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

This has resulted in a regression issue when we get 404 errors from S3. An example, if we call the following API with an object that does not exist, it should throw a NotFound error, instead throws a RestXMLDecodeError.missingRequiredData

try await s3Client.headObject(...)

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.

3 participants