Skip to content

[DRAFT] feature: use schema extensions for JSON and CBOR naming - #353

Draft
jterapin wants to merge 11 commits into
serde-data-drivenfrom
schema-extensions
Draft

[DRAFT] feature: use schema extensions for JSON and CBOR naming#353
jterapin wants to merge 11 commits into
serde-data-drivenfrom
schema-extensions

Conversation

@jterapin

@jterapin jterapin commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Previous PR added a stopgap reverse map on StructureShape keyed by both location_name and jsonName. That made member resolution protocol-blind: a jsonName wire key could resolve even when the protocol should use the model member name instead. This PR replaces that stopgap with lazy, per-protocol wire-name resolution for JSON and CBOR.

Base branch: serde-data-driven

Description

This PR removes the global reverse-map approach and moves wire-name resolution into the JSON and CBOR serde paths.

Highlights:

  • jsonName is now resolved only when the protocol actually uses it.
  • JSON and CBOR resolve members through lazy protocol-aware indexes instead of a schema-wide wire-name map.
  • MemberShape now uses model_name as the primary modeled member identity.
  • Codegen now emits model_name: and symbolized serde trait keys for the JSON/CBOR paths.

Behavior after this change:

  • JSON with json_name: true uses jsonName
  • JSON with json_name: false uses the model member name
  • CBOR uses the model member name

This keeps the fix focused: no Query/XML behavior changes are being introduced here.

Other Notes

  • MemberShape#initialize still falls back from model_name: to location_name: for downstream compatibility.
  • That fallback is currently needed because some downstream AWS Query/XML wrapper-member paths still construct members with location_name:.
  • The old eager member_by_wire_name path is removed.
  • The special union __type behavior is preserved only when it is explicitly modeled through jsonName.

Testing

Passed all specs.

@jterapin
jterapin changed the base branch from main to serde-data-driven August 19, 2026 22:27
@jterapin jterapin changed the title [DRAFT] feature: implement schema extensions [DRAFT] feature: use schema extensions for JSON and CBOR naming Aug 20, 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