Skip to content

Quote unresolvable idRef values in IDL serializer#3038

Merged
kstich merged 1 commit intomainfrom
dev/kstich/idref-quote-fix
Apr 8, 2026
Merged

Quote unresolvable idRef values in IDL serializer#3038
kstich merged 1 commit intomainfrom
dev/kstich/idref-quote-fix

Conversation

@kstich
Copy link
Copy Markdown
Contributor

@kstich kstich commented Apr 8, 2026

SmithyIdlModelSerializer rendered all @idref string values as bare shape IDs regardless of whether the referenced shape existed in the model. When @idref has failWhenMissing set to false (the default), the target shape may not exist, and the bare identifier produced invalid IDL that failed to re-parse.

The serializer now checks whether the shape ID resolves to a shape in the model before choosing the bare format. Unresolvable values fall through to quoted string rendering, which is always valid IDL and preserves round-trip fidelity.

Resolves: #2494


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kstich kstich requested a review from a team as a code owner April 8, 2026 06:47
@kstich kstich requested a review from JordonPhillips April 8, 2026 06:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

This pull request does not contain a staged changelog entry. To create one, use the ./.changes/new-change command. For example:

./.changes/new-change --pull-requests "#3038" --type feature --description "Quote unresolvable idRef values in IDL serializer"

Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See ./.changes/README or run ./.changes/new-change -h for more information.

SmithyIdlModelSerializer rendered all @idref string values as bare
shape IDs regardless of whether the referenced shape existed in the
model. When @idref has failWhenMissing set to false (the default),
the target shape may not exist, and the bare identifier produced
invalid IDL that failed to re-parse.

The serializer now checks whether the shape ID resolves to a shape
in the model before choosing the bare format. Unresolvable values
fall through to quoted string rendering, which is always valid IDL
and preserves round-trip fidelity.
@kstich kstich force-pushed the dev/kstich/idref-quote-fix branch from b468f28 to b8e3869 Compare April 8, 2026 06:53
@kstich kstich merged commit 4399994 into main Apr 8, 2026
16 checks passed
@kstich kstich deleted the dev/kstich/idref-quote-fix branch April 8, 2026 13:08
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.

SmithyIdlSerializer always renders idRefs unquoted

2 participants