Skip to content

unknown-encode

Id
@azure-tools/typespec-java/unknown-encode

Severity: warning

This diagnostic is issued when a bytes, duration, or date-time type uses an encoding that the Java emitter does not recognize.

The emitter falls back to the wire type or a string representation, so the generated Java type may not preserve the intended encoding.

@encode("custom-datetime")
scalar CustomDateTime extends utcDateTime;
Encode 'custom-datetime' is not supported.

Use a standard encoding supported by the corresponding TypeSpec scalar.

@encode(DateTimeKnownEncoding.rfc3339)
scalar CustomDateTime extends utcDateTime;

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.