Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify primitive values in an array are nullable #1155

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specification/common/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Attributes are a list of zero or more key-value pairs. An `Attribute` MUST have
- The attribute key, which MUST be a non-`null` and non-empty string.
- The attribute value, which 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,
- An array of nullable primitive type values. The array MUST be homogeneous,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but I generally feel a primitive type isn't nullable ...

Note that the spec does not take this Java-centric view. "primitive" in this context means merely what is written in the spec:

A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.

That said, I agree with your clarification, since strictly speaking the current wording is contradicting itself: it prohibits "null" on lines 19-20, then allows "null" on lines 33-39.

I am not sure "nullable" is fully understandable though. Should we be more explicit, e.g.:

An array of primitive type values or null values. The array MUST be homogeneous,
i.e. it MUST NOT contain values of different types. The only allowed exception to this rule is that certain array values may be null, while other values are not null (see more on arrays and nulls below).

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.

Expand Down