Skip to content

Commit

Permalink
Describe how to convert non-string primitives for protocols which onl…
Browse files Browse the repository at this point in the history
…y 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>
  • Loading branch information
3 people authored Mar 3, 2022
1 parent 9fa7c65 commit 0986b9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions specification/common/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0986b9d

Please sign in to comment.