Skip to content

Commit

Permalink
fix: request compression codegen was broken for operations specified …
Browse files Browse the repository at this point in the history
…under resource (#489)
  • Loading branch information
lucix-aws authored Dec 11, 2023
1 parent f982aed commit fa639ee
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import software.amazon.smithy.model.knowledge.TopDownIndex;
import software.amazon.smithy.model.shapes.OperationShape;
import software.amazon.smithy.model.shapes.ServiceShape;
import software.amazon.smithy.model.shapes.ShapeId;
import software.amazon.smithy.model.traits.RequestCompressionTrait;
import software.amazon.smithy.utils.ListUtils;
import software.amazon.smithy.utils.MapUtils;
Expand Down Expand Up @@ -81,13 +80,12 @@ public void writeAdditionalFiles(
GoDelegator goDelegator
) {
ServiceShape service = settings.getService(model);
for (ShapeId operationID : service.getAllOperations()) {
OperationShape operation = model.expectShape(operationID, OperationShape.class);
TopDownIndex.of(model).getContainedOperations(service).forEach(operation -> {
if (!operation.hasTrait(RequestCompressionTrait.class)) {
continue;
return;
}
goDelegator.useShapeWriter(operation, writeMiddlewareHelper(symbolProvider, operation));
}
});
}


Expand Down

0 comments on commit fa639ee

Please sign in to comment.