invalid-java-namespace
@azure-tools/typespec-java/invalid-java-namespaceSeverity: warning
This diagnostic is issued when a generated Java package segment is a reserved Java keyword.
Impact
Section titled “Impact”The emitter appends namespace to the reserved package segment, so the generated package differs from the requested namespace.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@servicenamespace Contoso.Public;The derived Java namespace contains the reserved keyword public.
Diagnostic Message
Section titled “Diagnostic Message”Namespace 'contoso.public' contains reserved Java keywords, replaced it with 'contoso.publicnamespace'.✅ How to Fix
Section titled “✅ How to Fix”Rename the TypeSpec namespace or configure a Java namespace that does not contain Java keywords.
@servicenamespace Contoso.PublicApi;Suppression
Section titled “Suppression”Suppress the warning only when the adjusted package name is intentionally accepted.