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

(docs): Remove use of sensitive trait on members in doc examples #1127

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
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 docs/source/1.0/guides/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Smithy models SHOULD resemble the following example:
namespace smithy.example.namespace

/// This is the documentation
@sensitive
@length(min: 1, max: 1000)
string MyShape

/// This is the documentation.
Expand Down
56 changes: 29 additions & 27 deletions docs/source/1.0/spec/core/idl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -806,12 +806,10 @@ Traits can be applied to the set shape and its members:

@deprecated
set StringSet {
member: SensitiveString
@pattern("\\w+")
member: String
}

@sensitive
string SensitiveString

.. code-tab:: json

{
Expand All @@ -820,17 +818,14 @@ Traits can be applied to the set shape and its members:
"smithy.example#StringSet": {
"type": "set",
"member": {
"target": "smithy.example#SensitiveString"
"target": "smithy.api#String",
"traits": {
"smithy.api#pattern": "\\w+"
}
},
"traits": {
"smithy.api#deprecated": {}
}
},
"smithy.example#SensitiveString": {
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
}
}
}
Expand Down Expand Up @@ -886,7 +881,7 @@ Traits can be applied to the map shape and its members:
@length(min: 1, max: 10)
key: String,

@sensitive
@range(min: 1, max: 1000)
value: Integer
}

Expand All @@ -907,9 +902,12 @@ Traits can be applied to the map shape and its members:
}
},
"value": {
"target": "smithy.api#String",
"target": "smithy.api#Integer",
"traits": {
"smithy.api#sensitive": {}
"smithy.api#range": {
"min": 1,
"max": 1000
}
}
},
"traits": {
Expand Down Expand Up @@ -1031,10 +1029,10 @@ The following example defines a union shape with several members:
union MyUnion {
i32: Integer,

stringA: String,
@length(min: 1, max: 100)
string: String,

@sensitive
gosar marked this conversation as resolved.
Show resolved Hide resolved
stringB: String,
time: Timestamp,
}

.. code-tab:: json
Expand All @@ -1048,14 +1046,15 @@ The following example defines a union shape with several members:
"i32": {
"target": "smithy.api#Integer"
},
"stringA": {
"target": "smithy.api#String"
},
"stringB": {
"string": {
"target": "smithy.api#String",
"traits": {
"smithy.api#sensitive": {}
"smithy.api#length": {
"min": 1,
"max": 100
}
},
"time": {
"target": "smithy.api#Timestamp"
}
}
}
Expand Down Expand Up @@ -1286,7 +1285,7 @@ Documentation comments can also be applied to members of a shape.
/// Documentation about the structure.
structure Example {
/// Documentation about the member.
@sensitive
@required
foo: String,
}

Expand All @@ -1307,7 +1306,7 @@ shape. The shape ID of a trait is *resolved* against :token:`smithy:use_statemen
and the current namespace in exactly the same way as
:ref:`other shape IDs <relative-shape-id>`.

The following example applies the :ref:`sensitive-trait` and
The following example applies the :ref:`length-trait` and
:ref:`documentation-trait` to ``MyString``:

.. tabs::
Expand All @@ -1316,7 +1315,7 @@ The following example applies the :ref:`sensitive-trait` and

namespace smithy.example

@sensitive
@length(min: 1, max: 100)
@documentation("Contains a string")
string MyString

Expand All @@ -1329,7 +1328,10 @@ The following example applies the :ref:`sensitive-trait` and
"type": "string",
"traits": {
"smithy.api#documentation": "Contains a string",
"smithy.api#sensitive": {}
"smithy.api#length": {
"min": 1,
"max": 100
}
}
}
}
Expand Down
28 changes: 16 additions & 12 deletions docs/source/1.0/spec/core/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ The following example defines a union shape with several members:
union MyUnion {
i32: Integer,

stringA: String,
@length(min: 1, max: 100)
string: String,

@sensitive
gosar marked this conversation as resolved.
Show resolved Hide resolved
stringB: String,
time: Timestamp,
}

.. code-tab:: json
Expand All @@ -845,14 +845,15 @@ The following example defines a union shape with several members:
"i32": {
"target": "smithy.api#Integer"
},
"stringA": {
"target": "smithy.api#String"
},
"stringB": {
"string": {
"target": "smithy.api#String",
"traits": {
"smithy.api#sensitive": {}
"smithy.api#length": {
"min": 1,
"max": 100
}
},
"time": {
"target": "smithy.api#Timestamp"
}
}
}
Expand Down Expand Up @@ -2177,15 +2178,15 @@ trait is applied to a shape depends on the model file representation.

Traits are applied to shapes in the IDL using :token:`smithy:trait_statements` that
immediately precede a shape. The following example applies the
:ref:`sensitive-trait` and :ref:`documentation-trait` to ``MyString``:
:ref:`length-trait` and :ref:`documentation-trait` to ``MyString``:

.. tabs::

.. code-tab:: smithy

namespace smithy.example

@sensitive
@length(min: 1, max: 100)
@documentation("Contains a string")
string MyString

Expand All @@ -2198,7 +2199,10 @@ immediately precede a shape. The following example applies the
"type": "string",
"traits": {
"smithy.api#documentation": "Contains a string",
"smithy.api#sensitive": {}
"smithy.api#length": {
"min": 1,
"max": 100
}
}
}
}
Expand Down