Skip to content

Commit ff661c7

Browse files
Tweak default zero value doc wording
1 parent 4411d14 commit ff661c7

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

docs/source/1.0/spec/aws/aws-core.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,11 @@ Trait selector
11131113
Value type
11141114
Annotation trait.
11151115

1116-
When a member is marked with this trait, it SHOULD always be generated as
1117-
optional even if the member also has the :ref:`required-trait` or
1118-
:ref:`default-trait`. This allows documentation generators to indicate that a
1119-
member is required, even if it is not reflected in the generated code. For
1120-
example:
1116+
When a member is marked with this trait, non-authoritative tooling like clients
1117+
SHOULD treat the member as optional even if the member also has the
1118+
:ref:`required-trait` or :ref:`default-trait`. This allows documentation
1119+
generators to indicate that a member is required, even if it is not reflected
1120+
in the generated code. For example:
11211121

11221122
.. code-block:: smithy
11231123

docs/source/1.0/spec/core/model.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,8 @@ provide member accessors that always return non-null values.
804804
with their :ref:`zero values <default-values>`.
805805
- When the :ref:`required-trait` is present on a member, the corresponding
806806
accessor SHOULD always return a non-null value.
807-
- Smithy implementations in languages like TypeScript that do not provide a kind
808-
of constructor or builder to create structures may not be able to set default
809-
values, precluding them from being able to treat required and default
810-
members as non-null.
807+
- An explicitly provided default zero value and a member that defaults to the
808+
zero value are indistinguishable.
811809
- Because the :ref:`required-trait` can be backward-compatibly removed from
812810
members of structures marked with the :ref:`input-trait` (that is, the input
813811
of an operation), code generators MUST generate code that does not break if

docs/source/1.0/spec/core/type-refinement-traits.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Summary
2424
Trait selector
2525
``structure > member :not(> :test(union, structure > :test([trait|required])))``
2626

27-
A member of a structure that does not target a union or structure.
27+
A member of a structure that does not target a union or a structure with
28+
required members.
2829
Value type
2930
Annotation trait.
3031

@@ -48,9 +49,8 @@ Default zero values
4849

4950
The following table describes the default zero value of each kind of shape.
5051
Programming languages and code generators that cannot initialize structure
51-
members with the following default values SHOULD continue to represent those
52-
members as nullable as this is semantically equivalent to the default zero
53-
value.
52+
members with the following default values SHOULD represent those members as
53+
nullable as this is semantically equivalent to the default zero value.
5454

5555
.. list-table::
5656
:header-rows: 1
@@ -67,10 +67,10 @@ value.
6767
- Numeric zero.
6868
* - string
6969
- empty string
70-
- Strings with the enum trait also have the same default value.
70+
- Strings with the :ref:`enum-trait` also have an empty string zero value.
7171
* - blob
7272
- empty blob
73-
- This includes blob shapes marked with the :ref:streaming-trait`.
73+
- This includes blob shapes marked with the :ref:`streaming-trait`.
7474
* - timestamp
7575
- Unix epoch
7676
- Zero seconds since the epoch (for example, ``0`` or

0 commit comments

Comments
 (0)