client-location-wrong-type
@azure-tools/typespec-client-generator-core/client-location-wrong-typeSeverity: warning
This diagnostic is issued when an operation marked with @clientLocation points to a target that is not a valid client location under the root namespace decorated with @service.
Impact
Section titled “Impact”- Area: Client operation placement. Generation continues, but the operation cannot be moved to a target outside the valid service client hierarchy.
- Not affected: The operation’s HTTP route and protocol metadata are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”namespace OtherNamespace {
}
@servicenamespace MyService { @clientLocation(OtherNamespace) // target is outside the `MyService` service namespace op list(): void;}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
`@clientLocation` could only move operation to the interface or namespace belong to the root namespace with `@service`.✅ How to Fix
Section titled “✅ How to Fix”Move the operation to an interface or namespace that belongs to the root service namespace, or define the intended target as a valid client under that service.
@servicenamespace MyService { namespace Operations {
}
@clientLocation(Operations) op list(): void;}Suppression
Section titled “Suppression”This diagnostic should not be suppressed. Move the operation to an interface or namespace that belongs to the root @service namespace.