Skip to content

feat(codegen): add Smithy RPCv2 JSON protocol - #8386

Merged
kingaly111 merged 2 commits into
mainfrom
kingaly/feat/rpcv2-json-protocol
Oct 29, 2026
Merged

kingaly111 merged 2 commits into
mainfrom
kingaly/feat/rpcv2-json-protocol

Conversation

@kingaly111

Copy link
Copy Markdown
Contributor

Register Rpcv2JsonTrait and an AwsSmithyRpcV2Json generator that extends the smithy-typescript SmithyRpcV2Json generator, with AWSQuery compatibility support mirroring AwsSmithyRpcV2Cbor. RPCv2 JSON is ordered ahead of RPCv2 CBOR, matching the existing JSON-first priority for JavaScript runtimes.

Depends on smithy-typescript#2295.

Issue

Issue number, if available, prefixed with "#"

Description

What does this implement/fix? Explain your changes.

Testing

How was this change tested?

Checklist

  • If the PR is a feature, add integration tests (*.integ.spec.ts) or E2E tests.
    • It's not a feature.
  • My E2E tests are resilient to concurrent i/o.
    • I didn't write any E2E tests.
  • I added access level annotations e.g. @public, @internal tags and enabled doc generation on the package. Remember that access level annotations go below the description, not above.
    • I didn't add any public functions.
  • Streams - how do they work?? My WebStream readers/locks are properly lifecycled. Node.js stream backpressure is handled. Error handling.
    • No streams here.

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

@kingaly111
kingaly111 marked this pull request as ready for review October 27, 2026 18:16
@kingaly111
kingaly111 requested a review from a team as a code owner October 27, 2026 18:16

@kuhe kuhe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

before we make this available in AWS SDK, the SmithyRpcV2JsonProtocol needs a local extension class which implements AwsQueryCompatible

@kingaly111
kingaly111 requested a review from kuhe October 28, 2026 17:10
Register Rpcv2JsonTrait and an AwsSmithyRpcV2Json generator that
extends the smithy-typescript SmithyRpcV2Json generator, with
AWSQuery compatibility support mirroring AwsSmithyRpcV2Cbor. RPCv2
JSON is ordered ahead of RPCv2 CBOR, matching the existing JSON-first
priority for JavaScript runtimes.

Depends on smithy-typescript#2295.
Extend SmithyRpcV2JsonProtocol with awsQueryCompatible support,
mirroring AwsSmithyRpcV2CborProtocol: send x-amzn-query-mode when
enabled and resolve errors via the x-amzn-query-error header through
ProtocolLib. Error members are read with the JSON codec's readObject,
as in the base class, since the error body is already parsed JSON.

Export it from @aws-sdk/core/protocols and @aws-sdk/config/protocol.
@kingaly111
kingaly111 force-pushed the kingaly/feat/rpcv2-json-protocol branch from 4610479 to 8ed8fd3 Compare October 28, 2026 20:50
@kingaly111
kingaly111 merged commit ee519d0 into main Oct 29, 2026
9 checks passed
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.

2 participants

⌂ 换网址