From 5a5e750bf984ad6088e8238397003c0d3693ec25 Mon Sep 17 00:00:00 2001 From: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Date: Wed, 12 Oct 2022 12:45:49 -0400 Subject: [PATCH] Clarify that lowerCamelCase field names MUST be used for OTLP/JSON (#2829) Resolves https://github.com/open-telemetry/opentelemetry-specification/issues/2795 This is a breaking change for OTLP/JSON and is allowed because OTLP/JSON is not yet Stable. --- specification/protocol/otlp.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specification/protocol/otlp.md b/specification/protocol/otlp.md index 75f6fd6f7..158e54c26 100644 --- a/specification/protocol/otlp.md +++ b/specification/protocol/otlp.md @@ -424,6 +424,13 @@ for mapping between Protobuf and JSON, with the following deviations from that m This aligns with the behavior of the Binary Protobuf unmarshaler and ensures that adding new fields to OTLP messages does not break existing receivers. +- The keys of JSON objects are field names converted to lowerCamelCase. Original + field names are not valid to use a keys of JSON objects. + For example this is a valid JSON representation of a Resource: + `{ "attributes": {...}, "droppedAttributesCount": 123 }`, and this is NOT a valid + representation: + `{ "attributes": {...}, "dropped_attributes_count": 123 }`. + Note that according to [Protobuf specs]( https://developers.google.com/protocol-buffers/docs/proto3#json) 64-bit integer numbers in JSON-encoded payloads are encoded as decimal strings, and either