Skip to content

Commit 7869cb4

Browse files
committed
Fix issues in mixin examples
This commit updates the service example to use renames for shapes that are not operations, as that is invalid. It also fixes a typo in the operation mixin example.
1 parent 8af6d08 commit 7869cb4

File tree

1 file changed

+32
-12
lines changed

1 file changed

+32
-12
lines changed

docs/source-2.0/spec/mixins.rst

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -492,22 +492,32 @@ example, in the following model:
492492

493493
.. code-block:: smithy
494494
495-
operation OperationA {}
495+
operation OperationA {
496+
input: OperationAInput
497+
output: OperationAOutput
498+
}
499+
500+
structure OperationAInput {}
501+
structure OperationAOutput {}
496502
497503
@mixin
498504
service A {
499505
version: "A"
500506
operations: [OperationA]
501507
}
502508
503-
operation OperationB {}
509+
operation OperationB {
510+
input: OperationBInput
511+
}
512+
513+
structure OperationBInput {}
504514
505515
@mixin
506516
service B with [A] {
507517
version: "B"
508518
rename: {
509-
"smithy.example#OperationA": "OperA"
510-
"smithy.example#OperationB": "OperB"
519+
"smithy.example#OperationAInput": "OperationARequest"
520+
"smithy.example#OperationAOutput": "OperationAResult"
511521
}
512522
operations: [OperationB]
513523
}
@@ -517,8 +527,8 @@ example, in the following model:
517527
service C with [B] {
518528
version: "C"
519529
rename: {
520-
"smithy.example#OperationA": "OpA"
521-
"smithy.example#OperationC": "OpC"
530+
"smithy.example#OperationAOutput": "OperationAResponse"
531+
"smithy.example#OperationBInput": "OperationBRequest"
522532
}
523533
operations: [OperationC]
524534
}
@@ -527,18 +537,28 @@ The flattened equivalent of ``C`` with no mixins is:
527537

528538
.. code-block:: smithy
529539
530-
operation OperationA {}
540+
operation OperationA {
541+
input: OperationAInput
542+
output: OperationAOutput
543+
}
544+
545+
structure OperationAInput {}
546+
structure OperationAOutput {}
547+
548+
operation OperationB {
549+
input: OperationBInput
550+
}
531551
532-
operation OperationB {}
552+
structure OperationBInput {}
533553
534554
operation OperationC {}
535555
536556
service C {
537557
version: "C"
538558
rename: {
539-
"smithy.example#OperationA": "OpA"
540-
"smithy.example#OperationB": "OperB"
541-
"smithy.example#OperationC": "OpC"
559+
"smithy.example#OperationAInput": "OperationARequest"
560+
"smithy.example#OperationAOutput": "OperationAResponse"
561+
"smithy.example#OperationBInput": "OperationBRequest"
542562
}
543563
operations: [OperationA, OperationB, OperationC]
544564
}
@@ -588,7 +608,7 @@ Operation shapes with the :ref:`mixin-trait` MAY define errors.
588608
output := {
589609
name: String
590610
}
591-
error: [NotFoundError]
611+
errors: [NotFoundError]
592612
}
593613
594614
@error("client")

0 commit comments

Comments
 (0)