Skip to content

Commit

Permalink
Fix shape check in event stream test tools
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Dec 20, 2022
1 parent c898100 commit 38598f2
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,22 @@ object EventStreamTestTools {
mode: CodegenTarget,
) {
for (member in shape.members()) {
if (member.target.namespace == "smithy.api") {
continue
}
val target = model.expectShape(member.target)
if (target is StructureShape || target is UnionShape) {
when (target) {
is StructureShape -> target.renderWithModelBuilder(model, symbolProvider, writer)
is UnionShape -> UnionGenerator(
model,
symbolProvider,
writer,
target,
renderUnknownVariant = mode.renderUnknownVariant(),
).render()
else -> TODO("EventStreamTestTools doesn't support rendering $target")
}
recursivelyGenerateModels(model, symbolProvider, target, writer, mode)
when (target) {
is StructureShape -> target.renderWithModelBuilder(model, symbolProvider, writer)
is UnionShape -> UnionGenerator(
model,
symbolProvider,
writer,
target,
renderUnknownVariant = mode.renderUnknownVariant(),
).render()
else -> TODO("EventStreamTestTools doesn't support rendering $target")
}
recursivelyGenerateModels(model, symbolProvider, target, writer, mode)
}
}
}

0 comments on commit 38598f2

Please sign in to comment.