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

Add some null value clarifications #596

Merged
merged 2 commits into from
Oct 7, 2020
Merged
Changes from 1 commit
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
20 changes: 20 additions & 0 deletions docs/source/1.0/spec/core/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,13 @@ The following example defines a set of strings:
}
}

.. rubric:: Providing values for a set

The values provided for a set are not permitted to be ``null``. ``null`` set
values do not provide much, if any, utility, and set implementations across
programming languages often do not support ``null`` values. If a ``null``
value is encountered for a set, it MUST be discarded.

.. rubric:: Set member shape ID

The shape ID of the member of a set is the set shape ID followed by
Expand Down Expand Up @@ -816,6 +823,12 @@ The following example defines a map of strings to integers:
}
}

.. rubric:: Providing keys for a map

Map keys are not permitted to be ``null``. Not all protocol serialization
formats have a way to define ``null`` map keys, and map implementations
across programming languages often do not allow ``null`` keys in maps.

.. rubric:: Map member shape IDs

The shape ID of the ``key`` member of a map is the map shape ID followed by
Expand Down Expand Up @@ -946,6 +959,13 @@ The following example defines a union shape with several members:
}
}

.. rubric:: Providing a value to a union

Exactly one member of a union MUST be set to a non-null value. In protocol
serialization formats that support ``null`` values (for example, JSON), if a
``null`` value is provided for a union member, it is discarded as if it was
not provided.

.. rubric:: Adding new members

New members added to existing unions SHOULD be added to the end of the
Expand Down