From 40e48309d8c51bbc2f3243e1ea188240a65d4557 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Mon, 14 Feb 2022 08:26:12 -0800 Subject: [PATCH 1/4] Describe how to handle converting non-string primitives for protocols that only support strings --- specification/common/common.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/common/common.md b/specification/common/common.md index f098255a221..923bec71624 100644 --- a/specification/common/common.md +++ b/specification/common/common.md @@ -24,10 +24,10 @@ An `Attribute` is a key-value pair, which MUST have the following properties: - The attribute key MUST be a non-`null` and non-empty string. - The attribute value is either: - - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. + - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. For protocols that do not natively support non-string values, such values SHOULD be represented as JSON strings. - An array of primitive type values. The array MUST be homogeneous, i.e., it MUST NOT contain values of different types. For protocols that do - not natively support array values such values SHOULD be represented as JSON strings. + not natively support array values, such values SHOULD be represented as JSON strings. Attribute values expressing a numerical value of zero, an empty string, or an empty array are considered meaningful and MUST be stored and passed on to From f8a6ab9470f25d6efc6ad96ef83754ada9b270cc Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Mon, 14 Feb 2022 10:34:05 -0800 Subject: [PATCH 2/4] update wording to make clear that only non-string values are converted to strings --- specification/common/common.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/common/common.md b/specification/common/common.md index 923bec71624..f45608aacba 100644 --- a/specification/common/common.md +++ b/specification/common/common.md @@ -24,7 +24,7 @@ An `Attribute` is a key-value pair, which MUST have the following properties: - The attribute key MUST be a non-`null` and non-empty string. - The attribute value is either: - - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. For protocols that do not natively support non-string values, such values SHOULD be represented as JSON strings. + - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON strings. - An array of primitive type values. The array MUST be homogeneous, i.e., it MUST NOT contain values of different types. For protocols that do not natively support array values, such values SHOULD be represented as JSON strings. From 573da87591e0c66bcba9546eeb32ecd0a9cc0588 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 15 Feb 2022 08:26:03 -0800 Subject: [PATCH 3/4] unify language --- specification/common/common.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/common/common.md b/specification/common/common.md index f45608aacba..7e22b97fb0c 100644 --- a/specification/common/common.md +++ b/specification/common/common.md @@ -24,10 +24,11 @@ An `Attribute` is a key-value pair, which MUST have the following properties: - The attribute key MUST be a non-`null` and non-empty string. - The attribute value is either: - - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON strings. + - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. - An array of primitive type values. The array MUST be homogeneous, - i.e., it MUST NOT contain values of different types. For protocols that do - not natively support array values, such values SHOULD be represented as JSON strings. + i.e., it MUST NOT contain values of different types. + +For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON strings. Attribute values expressing a numerical value of zero, an empty string, or an empty array are considered meaningful and MUST be stored and passed on to From 287e994eca7931eb01f22111fc5f1fcf0b8a2cf2 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 16 Feb 2022 13:59:23 -0500 Subject: [PATCH 4/4] Update specification/common/common.md Co-authored-by: Joshua MacDonald --- specification/common/common.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/common/common.md b/specification/common/common.md index 7e22b97fb0c..80a13012f44 100644 --- a/specification/common/common.md +++ b/specification/common/common.md @@ -28,7 +28,7 @@ An `Attribute` is a key-value pair, which MUST have the following properties: - An array of primitive type values. The array MUST be homogeneous, i.e., it MUST NOT contain values of different types. -For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON strings. +For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON-encoded strings. For example, the expression `int64(100)` will be encoded as `100`, `float64(1.5)` will be encoded as `1.5`, and an empty array of any type will be encoded as `[]`. Attribute values expressing a numerical value of zero, an empty string, or an empty array are considered meaningful and MUST be stored and passed on to