Skip to content

Commit

Permalink
(docs): Remove use of sensitive trait on members in doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Mar 11, 2022
1 parent 954697b commit 3d569c7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 40 deletions.
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
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
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

0 comments on commit 3d569c7

Please sign in to comment.