invalid-initialized-by
@azure-tools/typespec-client-generator-core/invalid-initialized-bySeverity: error
This diagnostic is issued when the initializedBy option in @clientInitialization is not a valid InitializedBy value or is invalid for the client position.
Impact
Section titled “Impact”- Area: SDK client construction. Blocks invalid client initialization metadata that would produce an impossible root or sub-client creation pattern.
- Not affected: Service operations and request/response payload shapes are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@clientInitialization({ initializedBy: InitializedBy.customizeCode | InitializedBy.parent, // `customizeCode` cannot be combined})namespace BlobClient {
}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
Invalid 'initializedBy' value. `InitializedBy.customizeCode` cannot be combined with other values.✅ How to Fix
Section titled “✅ How to Fix”Use InitializedBy.individually for root clients, InitializedBy.parent or InitializedBy.individually | InitializedBy.parent for sub clients, or InitializedBy.customizeCode by itself.
@clientInitialization({ initializedBy: InitializedBy.customizeCode,})namespace BlobClient {
}