Skip to content

Service sdk json #1367

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

Merged
merged 135 commits into from
Aug 12, 2025
Merged

Service sdk json #1367

merged 135 commits into from
Aug 12, 2025

Conversation

luigi617
Copy link
Collaborator

@luigi617 luigi617 commented Aug 6, 2025

  • Support Json protocol
  • Json protocol unit test

Issue #

Description of changes

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

luigi added 30 commits June 24, 2025 15:17
…hy-kotlin into server-sdk-main

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
…n into service-sdk-serde

# Conflicts:
#	codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/core/KotlinDependency.kt
#	codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/core/RuntimeTypes.kt
#	codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/service/ServiceStubGenerator.kt
@luigi617 luigi617 requested a review from a team as a code owner August 6, 2025 07:13
@luigi617 luigi617 added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Aug 6, 2025

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

luigi added 2 commits August 6, 2025 08:17

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

)
.write("var response: Any")
.write("var response: #T = $defaultResponse", serializerResultSymbol)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we sending default responses now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In renderSerializeHttpBody, if the output shape does not have a body, response will not be set, which causes an error indicating that response must be initialized.

KotlinTypes.Text.encodeToByteArray,
)
if (ctx.settings.build.generateServiceProject) {
writer.write("response = input.#L.value.toString()", memberName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be int since it's an INT_ENUM?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In serialization, JSON protocol will return a string as the response body. So, we need to convert everything in String

Copy link

Affected Artifacts

Changed in size
Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
telemetry-provider-micrometer-jvm.jar 22,796 22,788 8 0.04%
runtime-core-jvm.jar 834,702 834,754 -52 -0.01%
http-auth-jvm.jar 18,009 18,974 -965 -5.09%
http-client-jvm.jar 324,679 347,830 -23,151 -6.66%

@luigi617 luigi617 merged commit 4e86b3e into server-sdk-main Aug 12, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants