Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Dec 7, 2023
1 parent e841d48 commit b6f9796
Show file tree
Hide file tree
Showing 1,577 changed files with 395,600 additions and 28,021 deletions.
1,565 changes: 589 additions & 976 deletions 1.0/guides/building-models/build-config.html

Large diffs are not rendered by default.

674 changes: 196 additions & 478 deletions 1.0/guides/building-models/gradle-plugin.html

Large diffs are not rendered by default.

472 changes: 96 additions & 376 deletions 1.0/guides/building-models/index.html

Large diffs are not rendered by default.

1,574 changes: 618 additions & 956 deletions 1.0/guides/converting-to-openapi.html

Large diffs are not rendered by default.

509 changes: 117 additions & 392 deletions 1.0/guides/evolving-models.html

Large diffs are not rendered by default.

881 changes: 306 additions & 575 deletions 1.0/guides/generating-cloudformation-resources.html

Large diffs are not rendered by default.

453 changes: 92 additions & 361 deletions 1.0/guides/index.html

Large diffs are not rendered by default.

886 changes: 301 additions & 585 deletions 1.0/guides/model-linters.html

Large diffs are not rendered by default.

563 changes: 154 additions & 409 deletions 1.0/guides/style-guide.html

Large diffs are not rendered by default.

917 changes: 314 additions & 603 deletions 1.0/spec/aws/amazon-apigateway.html

Large diffs are not rendered by default.

606 changes: 167 additions & 439 deletions 1.0/spec/aws/aws-auth.html

Large diffs are not rendered by default.

1,365 changes: 518 additions & 847 deletions 1.0/spec/aws/aws-cloudformation.html

Large diffs are not rendered by default.

1,287 changes: 506 additions & 781 deletions 1.0/spec/aws/aws-core.html

Large diffs are not rendered by default.

714 changes: 211 additions & 503 deletions 1.0/spec/aws/aws-ec2-query-protocol.html

Large diffs are not rendered by default.

1,061 changes: 395 additions & 666 deletions 1.0/spec/aws/aws-iam.html

Large diffs are not rendered by default.

615 changes: 166 additions & 449 deletions 1.0/spec/aws/aws-json-1_0-protocol.html

Large diffs are not rendered by default.

624 changes: 167 additions & 457 deletions 1.0/spec/aws/aws-json-1_1-protocol.html

Large diffs are not rendered by default.

897 changes: 286 additions & 611 deletions 1.0/spec/aws/aws-query-protocol.html

Large diffs are not rendered by default.

620 changes: 163 additions & 457 deletions 1.0/spec/aws/aws-restjson1-protocol.html

Large diffs are not rendered by default.

631 changes: 169 additions & 462 deletions 1.0/spec/aws/aws-restxml-protocol.html

Large diffs are not rendered by default.

476 changes: 102 additions & 374 deletions 1.0/spec/aws/customizations/apigateway-customizations.html

Large diffs are not rendered by default.

482 changes: 106 additions & 376 deletions 1.0/spec/aws/customizations/glacier-customizations.html

Large diffs are not rendered by default.

457 changes: 97 additions & 360 deletions 1.0/spec/aws/customizations/index.html

Large diffs are not rendered by default.

476 changes: 102 additions & 374 deletions 1.0/spec/aws/customizations/machinelearning-customizations.html

Large diffs are not rendered by default.

533 changes: 131 additions & 402 deletions 1.0/spec/aws/customizations/s3-customizations.html

Large diffs are not rendered by default.

487 changes: 99 additions & 388 deletions 1.0/spec/aws/index.html

Large diffs are not rendered by default.

871 changes: 300 additions & 571 deletions 1.0/spec/core/auth-traits.html

Large diffs are not rendered by default.

963 changes: 256 additions & 707 deletions 1.0/spec/core/behavior-traits.html

Large diffs are not rendered by default.

1,017 changes: 365 additions & 652 deletions 1.0/spec/core/constraint-traits.html

Large diffs are not rendered by default.

781 changes: 254 additions & 527 deletions 1.0/spec/core/documentation-traits.html

Large diffs are not rendered by default.

868 changes: 297 additions & 571 deletions 1.0/spec/core/endpoint-traits.html

Large diffs are not rendered by default.

991 changes: 350 additions & 641 deletions 1.0/spec/core/http-traits.html

Large diffs are not rendered by default.

2,359 changes: 1,003 additions & 1,356 deletions 1.0/spec/core/idl.html

Large diffs are not rendered by default.

543 changes: 125 additions & 418 deletions 1.0/spec/core/index.html

Large diffs are not rendered by default.

1,086 changes: 408 additions & 678 deletions 1.0/spec/core/json-ast.html

Large diffs are not rendered by default.

834 changes: 281 additions & 553 deletions 1.0/spec/core/model-validation.html

Large diffs are not rendered by default.

2,749 changes: 1,222 additions & 1,527 deletions 1.0/spec/core/model.html

Large diffs are not rendered by default.

541 changes: 131 additions & 410 deletions 1.0/spec/core/prelude-model.html

Large diffs are not rendered by default.

694 changes: 208 additions & 486 deletions 1.0/spec/core/protocol-traits.html

Large diffs are not rendered by default.

697 changes: 212 additions & 485 deletions 1.0/spec/core/resource-traits.html

Large diffs are not rendered by default.

1,078 changes: 365 additions & 713 deletions 1.0/spec/core/selectors.html

Large diffs are not rendered by default.

1,051 changes: 390 additions & 661 deletions 1.0/spec/core/stream-traits.html

Large diffs are not rendered by default.

617 changes: 174 additions & 443 deletions 1.0/spec/core/type-refinement-traits.html

Large diffs are not rendered by default.

1,425 changes: 579 additions & 846 deletions 1.0/spec/core/xml-traits.html

Large diffs are not rendered by default.

868 changes: 299 additions & 569 deletions 1.0/spec/http-protocol-compliance-tests.html

Large diffs are not rendered by default.

476 changes: 94 additions & 382 deletions 1.0/spec/index.html

Large diffs are not rendered by default.

668 changes: 205 additions & 463 deletions 1.0/spec/mqtt.html

Large diffs are not rendered by default.

828 changes: 266 additions & 562 deletions 1.0/spec/waiters.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _sources/1.0/guides/building-models/gradle-plugin.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ This extension supports the following properties:
- ``FileCollection``
- Sets a custom collection of smithy-build.json files to use when
building the model.
* - allowUnknownTraits
* - allowsUnknownTraits
- ``boolean``
- Sets whether or not unknown traits in the model should be ignored. By
default, the build will fail if unknown traits are encountered.
Expand Down
4 changes: 2 additions & 2 deletions _sources/1.0/spec/aws/aws-core.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,15 @@ previous example:
Summary
Indicates that the target contains data of the specified classification.
Trait selector
``:test(simpleType, list, structure, union, member)``
``:test(simpleType, collection, structure, union, member)``
Value type
``string`` that is one of: ``content``, ``account``, ``usage``,
``tagging``, or ``permissions``. See :ref:`data-classifications` for more
information.

Data classifications are resolved hierarchically: the data classification
of a member inherits the effective data classification applied to a parent
structure, union, or list unless overridden.
structure, union, or collection unless overridden.

.. tabs::

Expand Down
80 changes: 33 additions & 47 deletions _sources/1.0/spec/core/constraint-traits.rst.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _constraint-traits:

=================
Constraint traits
=================
Expand Down Expand Up @@ -600,72 +598,61 @@ in a response.


.. smithy-trait:: smithy.api#uniqueItems
.. _uniqueItems-trait:
.. _uniqueItems:

---------------------
``uniqueItems`` trait
---------------------

.. warning::

This trait has been deprecated. It will be removed in future versions
of Smithy. Set shapes should be used instead.

Summary
Indicates that the items in a :ref:`list <list>` MUST be unique
based on :ref:`value-equality`.
Indicates that the items in a :ref:`list` MUST be unique.
Trait selector
``list :not(> member ~> :is(float, double, document))``
``:test(list > member > simpleType)``

*A list that does not transitively contain floats, doubles, or documents*
Conflicts with
* :ref:`sparse-trait`
*A list that targets any simple type.*
Value type
Annotation trait.

.. tabs::

.. code-block:: smithy
@uniqueItems
list MyList {
member: String
}
.. _value-equality:

Value equality
==============

Two values are considered equal if:

* They are the same type.
* Both are strings and are the same codepoint-for-codepoint.
* Both are blobs and are the same byte-for-byte.
* Both are booleans and are both true or are both false.
* Both are timestamps and refer to the same instant in time.
* Both are lists and have an equal value item-for-item. Note that
sets, a deprecated data type, are treated exactly like lists.
* Both are maps, have the same number of entries, and each key value
pair in one map has an equal key value pair in the other map. The
order of entries does not matter.
* Both are numbers of the same type and have the same mathematical value.
* Both are structures of the same type and have the same members with
equal values.
* Both are unions of the same type, are set to the same member, and the
set members have the same value.
.. code-tab:: smithy

.. note::
@uniqueItems
list MyList {
member: String,
}

Floats, doubles, and documents are not allowed in ``@uniqueItems`` lists
because they only allow for partial equivalence and require special care
to determine if two values are considered equal.
.. code-tab:: json

{
"smithy": "1.0",
"shapes": {
"smithy.example#MyList": {
"type": "list",
"member": {
"target": "smithy.api#String"
},
"traits": {
"smithy.api#uniqueItems": {}
}
}
}
}

.. _precedence:

----------------
Trait precedence
----------------

Some constraint traits can be applied to shapes as well as members.
Constraint traits applied to members take precedence over constraint
traits applied to the shape targeted by members.
Some constraints can be applied to shapes as well as structure members. If a
constraint of the same type is applied to a structure member and the shape
that the member targets, the trait applied to the member takes precedence.

In the below example, the ``range`` trait applied to ``numberOfItems``
takes precedence over the one applied to ``PositiveInteger``. The resolved
Expand Down Expand Up @@ -716,4 +703,3 @@ minimum will be ``7``, and the maximum ``12``.
.. _ECMA 262 regular expression dialect: https://www.ecma-international.org/ecma-262/8.0/index.html#sec-patterns
.. _CommonMark: https://spec.commonmark.org/
.. _OWASP Regular expression Denial of Service: https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
.. _JSON Schema "Instance Equality": https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.4.2.2
12 changes: 6 additions & 6 deletions _sources/1.0/spec/core/documentation-traits.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ These values use the same semantics and format as
{
title: "Error example for MyOperation",
input: {
foo: "!",
foo: 1,
},
error: {
shapeId: MyOperationError,
content: {
message: "Invalid 'foo'. Special character not allowed.",
message: "Invalid 'foo'",
}
}
},
Expand Down Expand Up @@ -395,12 +395,12 @@ Conflicts with
-------------------

Summary
Indicates that the data stored in the shape is sensitive and MUST be
handled with care.
Indicates that the data stored in the shape or member is sensitive
and MUST be handled with care.
Trait selector
``:not(:is(service, operation, resource, member))``
``:not(:is(service, operation, resource))``

*Any shape that is not a service, operation, resource, or member.*
*Any shape that is not a service, operation, or resource.*
Value type
Annotation trait

Expand Down
33 changes: 13 additions & 20 deletions _sources/1.0/spec/core/http-traits.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ multiple HTTP message locations (e.g., a member cannot be bound to both a URI
label and to a header). Only top-level members of an operation's input, output,
and error structures are considered when serializing HTTP messages.

.. important::

Violating `HTTP specifications`_ or relying on poorly-supported HTTP
functionality when defining HTTP bindings will limit interoperability
and likely lead to undefined behavior across Smithy implementations. For
example, avoid defining GET/DELETE requests with payloads, defining
response payloads for operations with a 204/205 status, etc.
.. contents:: Table of contents
:depth: 1
:local:
:backlinks: none


.. smithy-trait:: smithy.api#http
Expand Down Expand Up @@ -54,9 +51,7 @@ The ``http`` trait is a structure that supports the following members:
- ``integer``
- The HTTP status code of a successful response. Defaults to ``200`` if
not provided. The provided value SHOULD be between 100 and 599, and
it MUST be between 100 and 999. Status codes that do not allow a body
like 204 and 205 SHOULD bind all output members to locations other than
the body of the response.
it MUST be between 100 and 999.

The following example defines an operation that uses HTTP bindings:

Expand Down Expand Up @@ -518,11 +513,11 @@ Trait selector
.. code-block:: none
structure > :test(member > :test(boolean, number, string, timestamp,
list > member > :test(boolean, number, string, timestamp)))
collection > member > :test(boolean, number, string, timestamp)))
The ``httpHeader`` trait can be applied to ``structure`` members that
target a ``boolean``, ``number``, ``string``, or ``timestamp``; or a
``structure`` member that targets a list of these types.
``structure`` member that targets a list/set of these types.
Value type
``string`` value defining a valid HTTP header field name according to
:rfc:`section 3.2 of RFC7230 <7230#section-3.2>`. The value MUST NOT be
Expand Down Expand Up @@ -794,11 +789,10 @@ Trait selector
.. code-block:: none
structure > member
:test(> map :not([trait|sparse]) > member[id|member=value] > string)
:test(> map > member[id|member=value] > string)
The ``httpPrefixHeaders`` trait can be applied to ``structure`` members
that target a ``map`` of ``string``. The targeted map MUST NOT be marked
with the :ref:`sparse-trait`.
that target a ``map`` of ``string``.
Value type
``string`` value that defines the prefix to prepend to each header field
name stored in the targeted map member. For example, given a prefix value
Expand Down Expand Up @@ -875,7 +869,7 @@ Trait selector
structure > member
:test(> :test(string, number, boolean, timestamp),
> list > member > :test(string, number, boolean, timestamp))
> collection > member > :test(string, number, boolean, timestamp))
The ``httpQuery`` trait can be applied to ``structure`` members that
target a ``string``, ``number``, ``boolean``, or ``timestamp``; or a
Expand Down Expand Up @@ -932,7 +926,7 @@ request:
with a value of ``["a", "b"]``, the value is serialized in the query string
as ``foo=a&foo=b``.
* When deserializing, server implementations SHOULD use the first encountered
value in the query string for non-list members. For example, given a
value in the query string for non-collection members. For example, given a
member bound to ``foo`` that targets a string and a query string of
``foo=a&foo=b``, the deserialized value of ``foo`` should be ``a``.

Expand Down Expand Up @@ -975,10 +969,10 @@ Trait selector
.. code-block:: none
structure > member
:test(> map > member[id|member=value] > :test(string, list > member > string))
:test(> map > member[id|member=value] > :test(string, collection > member > string))
The ``httpQueryParams`` trait can be applied to ``structure`` members
that target a ``map`` of ``string``, or a ``map`` of ``list`` of
that target a ``map`` of ``string``, or a ``map`` of ``list``/``set`` of
``string``.

Value type
Expand Down Expand Up @@ -1338,4 +1332,3 @@ marked with the ``httpPayload`` trait:
.. _percent-encoded: https://tools.ietf.org/html/rfc3986#section-2.1
.. _HTTP request line: https://tools.ietf.org/html/rfc7230.html#section-3.1.1
.. _HTTP specifications: https://datatracker.ietf.org/doc/html/rfc7230
4 changes: 2 additions & 2 deletions _sources/1.0/spec/core/idl.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ is equivalent to the following JSON AST model:
"type": "structure",
"traits": {
"smithy.api#trait": {},
"smithy.api#documentation": "This is documentation about a trait shape.\n More docs here."
"smithy.api#documentation": "This is documentation about a trait shapes.\n More docs here."
}
}
}
Expand Down Expand Up @@ -1877,7 +1877,7 @@ is removed from a text block. The following example uses "." to denote spaces:
"""
..<div>
....<p>Hi\n....bar</p>
....<p>Hi\\n....bar</p>
..</div>
.."""
Expand Down
2 changes: 1 addition & 1 deletion _sources/1.0/spec/core/model-validation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ following constraints:
metadata validators = [{
name: "EmitEachSelector",
id: "MissingDocumentation",
message: "This shape is missing documentation",
message: "This shape is missing documentation"
configuration: {
selector: """
:not([trait|documentation])
Expand Down
36 changes: 10 additions & 26 deletions _sources/1.0/spec/core/model.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ reference other shapes using :ref:`members <member>`.
* - :ref:`list`
- Ordered collection of homogeneous values
* - :ref:`set`
- (Deprecated) Ordered collection of unique homogeneous values
- Ordered collection of unique homogeneous values
* - :ref:`map`
- Map data structure that maps string keys to homogeneous values
* - :ref:`structure`
Expand Down Expand Up @@ -565,19 +565,10 @@ example is ``smithy.example#MyList$member``.
Set
===

.. danger::

Sets are deprecated. Use a list with the :ref:`uniqueItems-trait` instead.

The :dfn:`set` type represents an ordered collection of unique values. A set
shape requires a single member named ``member``. Sets are implicitly considered
to be marked with the :ref:`uniqueItems-trait`, and as such MUST NOT transitively
contain floats, doubles, or documents.

.. important::

Sets are considered sub-type of lists; any place a list is accepted, a set
is accepted.
shape requires a single member named ``member``, and the member MUST target
either a string, blob, byte, short, integer, long, bigInteger, or bigDecimal
shape. The targeted shape MUST NOT be marked with the :ref:`streaming-trait`.

Sets are defined in the IDL using a :ref:`set_statement <idl-set>`. The
following example defines a set of strings:
Expand Down Expand Up @@ -623,14 +614,11 @@ The shape ID of the member of a set is the set shape ID followed by
``$member``. For example, the shape ID of the set member in the above
example is ``smithy.example#StringSet$member``.

.. rubric:: Use insertion order
.. rubric:: Language support for insertion ordered sets

Implementations SHOULD use insertion ordered sets to ensure that clients and
servers both agree on element ordering so that error messages about specific
items in a set are actionable by clients. If a client and server don't agree
on ordering, then pointing to where a validation error occurs becomes very
challenging. Programming languages that do not support insertion ordered sets
SHOULD store the values of a set in a list.
Not all programming languages support an insertion ordered set data
structure. Such languages SHOULD store the values of a set data
structure in a list and rely on validation to ensure uniqueness.


.. _map:
Expand Down Expand Up @@ -979,12 +967,8 @@ Smithy allows recursive shape definitions with the following limitations:
that shapes that are typically impossible to define in various programming
languages are not defined in Smithy models (for example, you can't define
a recursive list in Java ``List<List<List....``).
2. To ensure a value can be provided for a structure, recursive member
relationship from a structure back to itself MUST NOT be made up of all
:ref:`required <required-trait>` structure members.
3. To ensure a value can be provided for a union, recursive unions MUST
contain at least one path through its members that is not recursive
or steps through a list, set, map, or optional structure member.
2. A structure cannot contain a cyclical set of members marked with the
:ref:`required-trait` that refers back to itself.

The following recursive shape definition is **valid**:

Expand Down
8 changes: 3 additions & 5 deletions _sources/1.0/spec/core/selectors.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ Shapes can be matched by type using the following tokens:
* - ``simpleType``
- Matches all :ref:`simple types <simple-types>`
* - ``collection``
- Deprecated: Matches both a ``list`` and ``set`` shape.
This is considered an alias for ``list``.
- Matches both a ``list`` and ``set`` shape
* - ``blob``
- Matches blob shapes
* - ``boolean``
Expand Down Expand Up @@ -107,10 +106,9 @@ Shapes can be matched by type using the following tokens:
* - ``timestamp``
- Matches timestamp shapes
* - ``list``
- Matches list shapes. Note that set shapes also match ``list`` because
they are considered sub-types of list.
- Matches list shapes
* - ``set``
- Deprecated: Matches set shapes. This is considered an alias for ``list``.
- Matches set shapes
* - ``map``
- Matches map shapes
* - ``structure``
Expand Down
Loading

0 comments on commit b6f9796

Please sign in to comment.