Skip to content

Commit a4cbd8e

Browse files
committed
Account for error shapes as well
1 parent 517392f commit a4cbd8e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

codegen/src/main/java/software/amazon/awssdk/codegen/AddShapes.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import software.amazon.awssdk.codegen.model.intermediate.ReturnTypeModel;
3737
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
3838
import software.amazon.awssdk.codegen.model.intermediate.VariableModel;
39+
import software.amazon.awssdk.codegen.model.service.ErrorMap;
3940
import software.amazon.awssdk.codegen.model.service.Location;
4041
import software.amazon.awssdk.codegen.model.service.Member;
4142
import software.amazon.awssdk.codegen.model.service.Operation;
@@ -344,6 +345,16 @@ private boolean isDirectOperationInputOrOutput(Shape parentShape, Map<String, Sh
344345
return true;
345346
}
346347
}
348+
349+
if (operation.getErrors() != null) {
350+
for (ErrorMap error : operation.getErrors()) {
351+
String errorShapeName = error.getShape();
352+
Shape outputShape = allC2jShapes.get(errorShapeName);
353+
if (parentShape.equals(outputShape)) {
354+
return true;
355+
}
356+
}
357+
}
347358
}
348359
return false;
349360
}

0 commit comments

Comments
 (0)