Add AddSmithyShapes base class to translate Smithy shapes into the codegen intermediate model - #7218
Open
Fred1155 wants to merge 5 commits into
Open
Conversation
S-Saranya1
reviewed
Aug 6, 2026
S-Saranya1
approved these changes
Aug 6, 2026
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.
Motivation and Context
This is part of the incremental migration of the code generator from the C2J model to Smithy as the source of truth for the intermediate model. The existing C2J path builds
ShapeModel/MemberModelobjects from C2J shapes;the Smithy path needs an equivalent that produces the same IM from a Smitht
Model.This PR adds the shared, protocol-aware base class that does that shape/member translation. It is the foundation the concrete shape processors (input, output, exception, and model shapes) will extend in a follow-up PR. The goal
throughout is C2J parity: given the same API, the Smithy-derived IM should match what the C2J path produces today.
Modifications
AddSmithyShapes(new, abstract): shared base for the Smithy shape processors. Two entry points:generateShapeModel(...)builds aShapeModeland all of its members, setting shape-level metadata from traits (documentation, deprecation, XML namespace, error/fault, retryable/throttling) and from shape kind (union, event stream, string-enum values).generateMemberModel(...)builds a singleMemberModel(names via the naming strategy, type viaTypeUtils, timestamp format, sensitivity, idempotency token, event header/payload, context param, list/map models, and HTTP mapping).HttpBindingIndexfor HTTP bindings,TopDownIndexfor reachable operations, and@requiredmembership for therequiredlist/flag (matching C2J semantics rather than Smithy's richer nullability).SmithyWireNames(new): resolves per-protocolmarshallLocationName/unmarshallLocationNamefor a member — the Smithy counterpart to C2J'sderive*LocationName. Applies the name-override trait (@xmlName/@jsonName), then the HTTP binding location name, then the member name; EC2 has its own rule (@ec2QueryName, else first-character upper-casing), and synthetic list/map elements keep their literal lower-case names.codegen/pom.xml: add thesmithy-rules-enginedependency, needed forContextParamTrait.Scope note: the base class is not yet invoked by production code generation. it is exercised only by the unit tests below. The concrete subclasses and their registration into the processor chain come in a follow-up PR, so there is no change to any generated SDK output in this change.
Testing
AddSmithyShapesShapeModelTest(13 tests): shape-level translation.AddSmithyShapesMemberModelTest(30 tests): member-level translation.Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License