Describe how to convert non-string primitives for protocols which only support strings (#2343)

* Describe how to handle converting non-string primitives for protocols that only support strings

* update wording to make clear that only non-string values are converted to strings

* unify language

* Update specification/common/common.md

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>

Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
David Ashpole 2022-03-03 00:30:53 -05:00 committed by Josh Suereth
parent 1637677327
commit 5bf1bbed5b
1 changed files with 3 additions and 2 deletions

View File

@ -26,8 +26,9 @@ An `Attribute` is a key-value pair, which MUST have the following properties:
- The attribute value is either:
- 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-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