Skip to content

Commit

Permalink
Cleanup rails-json httpPayloadMember
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Jul 18, 2023
1 parent 7309629 commit 8573788
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,15 @@ protected void renderOperationBodyBuilder(OperationShape operation, Shape inputS
HttpPrefixHeadersTrait.class) && !m.hasTrait(HttpQueryParamsTrait.class));
if (serializeBody) {
//determine if there is an httpPayload member
List<MemberShape> httpPayloadMembers = inputShape.members()
Optional<MemberShape> httpPayloadMember = inputShape.members()
.stream()
.filter((m) -> m.hasTrait(HttpPayloadTrait.class))
.collect(Collectors.toList());
if (httpPayloadMembers.size() == 0) {
.findFirst();
if (httpPayloadMember.isEmpty()) {
renderBodyBuilder(operation, inputShape);
} else {
MemberShape payloadMember = httpPayloadMembers.get(0);
Shape target = model.expectShape(payloadMember.getTarget());
renderPayloadBodyBuilder(operation, inputShape, payloadMember, target);
Shape target = model.expectShape(httpPayloadMember.get().getTarget());
renderPayloadBodyBuilder(operation, inputShape, httpPayloadMember.get(), target);
}
}
}
Expand Down

0 comments on commit 8573788

Please sign in to comment.