-
Notifications
You must be signed in to change notification settings - Fork 992
Fix codegen to ignore httpLabel on non-input shapes per Smithy spec #6789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
9116605
1b094c0
48e1b37
cbb38f4
517392f
a4cbd8e
d0daa36
e7f2ce7
c4a79f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,8 +84,23 @@ void generateShapeModel_memberRequiredByNestedShape_setsMemberModelAsRequired() | |
| MemberModel requiredMemberModel = requestShapeModel.findMemberModelByC2jName(queryParamName); | ||
|
|
||
| assertThat(requestShapeModel.getRequired()).contains(queryParamName); | ||
| assertThat(requiredMemberModel.getHttp().getLocation()).isEqualTo(Location.QUERY_STRING); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we removing this assertion ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it was asserting the buggy behavior. |
||
| assertThat(requiredMemberModel.getHttp().getLocation()).isNull(); | ||
| assertThat(requiredMemberModel.isRequired()).isTrue(); | ||
| } | ||
|
|
||
| @Test | ||
| void generateShapeModel_locationOnNestedShape_isIgnored() { | ||
| ShapeModel nestedShape = intermediateModel.getShapes().get("NestedQueryParameterOperation"); | ||
| MemberModel queryParam = nestedShape.findMemberModelByC2jName("QueryParamOne"); | ||
| assertThat(queryParam.getHttp().getLocation()).isNull(); | ||
| } | ||
|
|
||
| @Test | ||
| void generateShapeModel_locationOnDirectInputShape_isPreserved() { | ||
| ShapeModel inputShape = intermediateModel.getShapes().get("QueryParameterOperationRequest"); | ||
| assertThat(inputShape.findMemberModelByC2jName("PathParam").getHttp().getLocation()).isEqualTo(Location.URI); | ||
| assertThat(inputShape.findMemberModelByC2jName("QueryParamOne").getHttp().getLocation()).isEqualTo(Location.QUERY_STRING); | ||
| assertThat(inputShape.findMemberModelByC2jName("StringHeaderMember").getHttp().getLocation()).isEqualTo(Location.HEADER); | ||
| } | ||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.