Skip to content

no-service

Id
@azure-tools/typespec-java/no-service

Severity: warning

This diagnostic is issued when the TypeSpec program does not contain a namespace marked with @service.

No Java client is generated because the emitter cannot identify the service root. Models with explicit usage and access metadata can still be generated.

import "@azure-tools/typespec-client-generator-core";
using Azure.ClientGenerator.Core;
@access(Access.public)
@usage(Usage.input | Usage.output)
model Widget {
name: string;
}

This generates the public Widget Java model without generating a service client. The warning is expected for this use case.

No service found in this TypeSpec. Client will not be generated.

If a Java client is intended, mark the service namespace with @service and define its operations.

@service
namespace Contoso {
op ping(): void;
}

It is safe to suppress this warning when the TypeSpec intentionally generates only model classes.