refactor: drive JSON/CBOR serde off the data with a load-time wire-name map - #351
Open
jterapin wants to merge 13 commits into
Open
refactor: drive JSON/CBOR serde off the data with a load-time wire-name map#351jterapin wants to merge 13 commits into
jterapin wants to merge 13 commits into
Conversation
jterapin
force-pushed
the
serde-data-driven
branch
from
August 19, 2026 22:52
4c433ea to
a1dc496
Compare
jterapin
marked this pull request as ready for review
August 20, 2026 15:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This is the first PR in the current schema-serde stack.
V4 currently walks every declared structure member on each request and response and resolves wire names inline. This PR changes JSON and CBOR structure serde to work from the actual payload or input data instead, using a load-time member lookup to recover the same basic shape V3 had.
Follow-up PR #353 builds on this by replacing the temporary global lookup with protocol-aware schema extensions. I still want early feedback on the traversal change itself, which is why I am splitting the work this way.
What changed
StructureShapebuilds a load-time@members_by_wire_nameindex atadd_member, keyed by each member'slocation_nameandjsonNamewhen present.Testing
bundle exec rake smithy-schema:specbundle exec rake smithy-json:specbundle exec rake smithy-cbor:specbundle exec rake smithy:spec:unitbundle exec rake smithy:spec:protocols smithy:rbs:protocolsbundle exec rake smithy-schema:rbsaws-sdk-ruby-stagingprotocol validation green forawsJson1_0,awsJson1_1,restJson1,awsQuery,ec2Query, andrestXmlNotes
jsonNameis only used when the active protocol actually requires it.--
Written with AI assistance and reviewed by jterapin.