Skip to content
Merged
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
44 changes: 32 additions & 12 deletions docs/source-2.0/spec/mixins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,22 +492,32 @@ example, in the following model:

.. code-block:: smithy

operation OperationA {}
operation OperationA {
input: OperationAInput
output: OperationAOutput
}

structure OperationAInput {}
structure OperationAOutput {}

@mixin
service A {
version: "A"
operations: [OperationA]
}

operation OperationB {}
operation OperationB {
input: OperationBInput
}

structure OperationBInput {}

@mixin
service B with [A] {
version: "B"
rename: {
"smithy.example#OperationA": "OperA"
"smithy.example#OperationB": "OperB"
"smithy.example#OperationAInput": "OperationARequest"
"smithy.example#OperationAOutput": "OperationAResult"
}
operations: [OperationB]
}
Expand All @@ -517,8 +527,8 @@ example, in the following model:
service C with [B] {
version: "C"
rename: {
"smithy.example#OperationA": "OpA"
"smithy.example#OperationC": "OpC"
"smithy.example#OperationAOutput": "OperationAResponse"
"smithy.example#OperationBInput": "OperationBRequest"
}
operations: [OperationC]
}
Expand All @@ -527,18 +537,28 @@ The flattened equivalent of ``C`` with no mixins is:

.. code-block:: smithy

operation OperationA {}
operation OperationA {
input: OperationAInput
output: OperationAOutput
}

structure OperationAInput {}
structure OperationAOutput {}

operation OperationB {
input: OperationBInput
}

operation OperationB {}
structure OperationBInput {}

operation OperationC {}

service C {
version: "C"
rename: {
"smithy.example#OperationA": "OpA"
"smithy.example#OperationB": "OperB"
"smithy.example#OperationC": "OpC"
"smithy.example#OperationAInput": "OperationARequest"
"smithy.example#OperationAOutput": "OperationAResponse"
"smithy.example#OperationBInput": "OperationBRequest"
}
operations: [OperationA, OperationB, OperationC]
}
Expand Down Expand Up @@ -588,7 +608,7 @@ Operation shapes with the :ref:`mixin-trait` MAY define errors.
output := {
name: String
}
error: [NotFoundError]
errors: [NotFoundError]
}

@error("client")
Expand Down
Loading