type-not-supported-on-text-plain
@azure-tools/typespec-java/type-not-supported-on-text-plainSeverity: warning
This diagnostic is issued when an operation uses an enum request or response body with text/plain.
Impact
Section titled “Impact”The emitter substitutes String for the unsupported Java type on the request or response body.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”enum Color { red, blue,}
@postop setColor(@header contentType: "text/plain", @body color: Color): void;Diagnostic Message
Section titled “Diagnostic Message”Complex SDK type is not supported for "text/plain" content-type. Emitter would use string type on 'setColor' request body.✅ How to Fix
Section titled “✅ How to Fix”Use string for a text payload, or use a structured content type such as application/json when the SDK type should remain strongly typed.
@postop setColor(@header contentType: "text/plain", @body color: string): void;Suppression
Section titled “Suppression”Suppress the warning only when the generated String API is the intended contract.