diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index 552093e446..691af914bd 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -201,9 +201,12 @@ export class CodeModelBuilder { } const service = listServices(this.program)[0]; + if (!service) { + this.logWarning("TypeSpec for HTTP client should define a service."); + } this.serviceNamespace = service?.type ?? this.program.getGlobalNamespaceType(); - this.namespace = getNamespaceFullName(this.serviceNamespace) || "Azure.Client"; + this.namespace = getNamespaceFullName(this.serviceNamespace) || "Client"; const namespace1 = this.namespace; this.typeNameOptions = {