Fix codegen to ignore httpLabel on non-input shapes per Smithy spec#6789
Open
Fix codegen to ignore httpLabel on non-input shapes per Smithy spec#6789
Conversation
dd6a8b4 to
cbb38f4
Compare
|
joviegas
reviewed
Mar 13, 2026
| return ModelInvalidException.builder().validationEntries(Collections.singletonList(entry)).build(); | ||
| }); | ||
| if (!operation.isPresent()) { | ||
| // Not a direct operation input shape, should be ignored. |
Contributor
There was a problem hiding this comment.
How does generated code looks like when we have below
"NestedOptions": {
"type": "structure",
"members": {
"pageSize": {
"shape": "String",
"location": "uri",
"locationName": "pageSize"
}
}
}when we say
httpLabel is only considered when applied to top-level members of an operation's input structure. This trait has no meaning in any other context and is simply ignored.
what does ignore mean ? should we internally treat it as
"NestedOptions": {
"type": "structure",
"members": {
"pageSize": {
"shape": "String",
"locationName": "pageSize"
}
}
}
and marshall it in the regular payload. , just as we do for shapes where locationName is not specified
Or completely remove pageSize from NestedOptions structure ?
Can we please have a test case comparing a generated code ?
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.




Per the Smithy spec, httpLabel on non-input shapes "has no meaning and is simply ignored." However,
AddShapes.findRequestUri()was throwing aModelInvalidExceptionwhen it found a shape with a URI bound member that wasn't a direct operation input.When the shape isn't a direct operation input, it now returns empty instead of throwing (results in codegen ignoring this member). The existing validation for operations with a missing
requestUriis unchanged.