Skip to content

refactor: Drive JSON/CBOR serde off the data with a load-time wire-name map - #351

Draft
jterapin wants to merge 3 commits into
mainfrom
serde-data-driven
Draft

refactor: Drive JSON/CBOR serde off the data with a load-time wire-name map#351
jterapin wants to merge 3 commits into
mainfrom
serde-data-driven

Conversation

@jterapin

Copy link
Copy Markdown
Contributor

Context

V4 walks every declared schema member on each request and response and resolves each wire name inline. This restores the load-time reverse map V3 had and drives JSON/CBOR (de)serialization off the data instead of the full member list.

What changed

  • StructureShape builds @members_by_wire_name at add_member, keyed by each member's location_name and jsonName (when different); wire-name collisions raise at load.
  • JSON and CBOR structure build/parse now iterate the input values / payload keys and resolve members through the map.
  • XML is unchanged; member order is its serialization contract.

Testing

  • smithy unit + RBS suites green; aws-sdk-ruby-staging protocol conformance green (awsJson1_0/1_1, restJson1; awsQuery/ec2Query/restXml unaffected).
  • Benchmarked vs baseline on real generated clients (stub_responses): codec hot path ~1.5-1.7x faster on wide-sparse structures, ~1.15x wide-dense, batch payloads parity.

--
Written with AI assistance and reviewed by jterapin.

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

@jterapin jterapin changed the title feat: refactor: Drive JSON/CBOR serde off the data with a load-time wire-name map Aug 14, 2026
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.

1 participant