inconsistent-multiple-service
@azure-tools/typespec-client-generator-core/inconsistent-multiple-serviceSeverity: error
This diagnostic is issued when multiple services merged into one @client declaration do not have the same server and authentication definitions.
Impact
Section titled “Impact”- Area: Multi-service client merging. Blocks a combined client when merged services do not agree on endpoint or authentication shape.
- Not affected: The individual service definitions, servers, and auth settings remain unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@service@server("https://servicea.example.com")namespace ServiceA {
}
@service@server("https://serviceb.example.com") // differs from ServiceA servernamespace ServiceB {
}
@client({ name: "CombineClient", service: [ServiceA, ServiceB], autoMergeService: true,})namespace CombineClient {
}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
All services must have the same server and auth definitions.✅ How to Fix
Section titled “✅ How to Fix”Make the merged services use matching server and auth definitions, or generate them as separate clients.
@service@server("https://service.example.com")namespace ServiceA {
}
@service@server("https://service.example.com")namespace ServiceB {
}
@client({ name: "CombineClient", service: [ServiceA, ServiceB], autoMergeService: true,})namespace CombineClient {
}