Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ public void generateOperation(GenerateOperationDirective<CodeGenerationContext,
if (isSynthetic(directive.shape())) {
return;
}
if (isTypesOnly()) {
return;
}
if (modes.contains(CodegenMode.SERVER)) {
new OperationInterfaceGenerator().accept(directive);
}
Expand All @@ -144,8 +147,7 @@ public void generateOperation(GenerateOperationDirective<CodeGenerationContext,
@Override
public void generateService(GenerateServiceDirective<CodeGenerationContext, JavaCodegenSettings> directive) {
// In TYPES-only mode, generateService is a no-op (the synthetic service has no real service shape)
if (modes.contains(CodegenMode.TYPES) && !modes.contains(CodegenMode.CLIENT)
&& !modes.contains(CodegenMode.SERVER)) {
if (isTypesOnly()) {
return;
}

Expand Down Expand Up @@ -193,4 +195,10 @@ public void customizeAfterIntegrations(CustomizeDirective<CodeGenerationContext,
private static boolean isSynthetic(Shape shape) {
return shape.getId().getNamespace().equals(SyntheticServiceTransform.SYNTHETIC_NAMESPACE);
}

private boolean isTypesOnly() {
return modes.contains(CodegenMode.TYPES)
&& !modes.contains(CodegenMode.CLIENT)
&& !modes.contains(CodegenMode.SERVER);
}
}