From 4bb03a519b551ee8310994124212c93ea03e6f63 Mon Sep 17 00:00:00 2001 From: Andrew Steurer <94206073+asteurer@users.noreply.github.com> Date: Wed, 4 Feb 2026 03:31:37 +0000 Subject: [PATCH] doc: documenting how byte arrays are handled when converted to JSON Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com> --- wit/types.wit | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wit/types.wit b/wit/types.wit index 6f8ce21..6fa87b5 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -14,6 +14,10 @@ interface types { /// /// This corresponds with the `AnyValue` type defined in the [attribute spec](https://opentelemetry.io/docs/specs/otel/common/#anyvalue). /// Because WIT doesn't support recursive types, the data needs to be serialized. JSON is used as the encoding format. + /// + /// Byte arrays require special encoding since JSON cannot distinguish them from number arrays. + /// They are base64-encoded with a prefix that follows the Data URI RFC 2397 convention: + /// `data:application/octet-stream;base64,` type value = string; /// An immutable representation of the entity producing telemetry as attributes.