Skip to content

Commit

Permalink
feat(serde): use ternary
Browse files Browse the repository at this point in the history
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
  • Loading branch information
kuhe and trivikr committed Oct 12, 2022
1 parent b6abf9a commit 0fdf3ca
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,9 @@ private static boolean hasStreamingBlobDeser(TypeScriptSettings settings, Model
}

public static boolean hasStreamingBlobDeser(TypeScriptSettings settings, Model model, OperationShape operation) {
StructureShape ioShapeToDeser;
if (settings.generateServerSdk()) {
ioShapeToDeser = model.expectShape(operation.getInputShape()).asStructureShape().get();
} else {
ioShapeToDeser = model.expectShape(operation.getOutputShape()).asStructureShape().get();
}
StructureShape ioShapeToDeser = (settings.generateServerSdk())
? model.expectShape(operation.getInputShape()).asStructureShape().get()
: model.expectShape(operation.getOutputShape()).asStructureShape().get();
for (MemberShape member : ioShapeToDeser.members()) {
Shape shape = model.expectShape(member.getTarget());
if (shape instanceof BlobShape && shape.hasTrait(StreamingTrait.class)) {
Expand Down

0 comments on commit 0fdf3ca

Please sign in to comment.