unknown-encode
@azure-tools/typespec-java/unknown-encodeSeverity: warning
This diagnostic is issued when a bytes, duration, or date-time type uses an encoding that the Java emitter does not recognize.
Impact
Section titled “Impact”The emitter falls back to the wire type or a string representation, so the generated Java type may not preserve the intended encoding.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@encode("custom-datetime")scalar CustomDateTime extends utcDateTime;Diagnostic Message
Section titled “Diagnostic Message”Encode 'custom-datetime' is not supported.✅ How to Fix
Section titled “✅ How to Fix”Use a standard encoding supported by the corresponding TypeSpec scalar.
@encode(DateTimeKnownEncoding.rfc3339)scalar CustomDateTime extends utcDateTime;Suppression
Section titled “Suppression”Suppress this warning only when the fallback Java representation and wire format have been verified, or when the generated Java library will be customized to implement the intended encoding.