-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process Operation Context Params in Endpoints (#1379)
- Loading branch information
Showing
4 changed files
with
186 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...re/amazon/smithy/typescript/codegen/endpointsV2/endpoints-operation-context-params.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
$version: "2.0" | ||
|
||
namespace smithy.example | ||
|
||
@smithy.rules#endpointRuleSet({ | ||
version: "1.0", | ||
parameters: { | ||
opContextParamIdentifier: { | ||
type: "string", | ||
}, | ||
opContextParamSubExpression: { | ||
type: "string", | ||
}, | ||
opContextParamWildcardExpressionList: { | ||
type: "stringArray", | ||
}, | ||
opContextParamWildcardExpressionListObj: { | ||
type: "stringArray", | ||
}, | ||
opContextParamWildcardExpressionHash: { | ||
type: "stringArray", | ||
}, | ||
opContextParamKeys: { | ||
type: "stringArray", | ||
}, | ||
}, | ||
rules: [] | ||
}) | ||
service Example { | ||
version: "1.0.0", | ||
operations: [GetFoo] | ||
} | ||
|
||
@smithy.rules#operationContextParams( | ||
"opContextParamIdentifier": { path: "fooString" } | ||
"opContextParamSubExpression": { path: "fooObj.bar" } | ||
"opContextParamWildcardExpressionList": { path: "fooList[*]" } | ||
"opContextParamWildcardExpressionListObj": { path: "fooListObj[*].key" } | ||
"opContextParamWildcardExpressionHash": { path: "fooObjObj.*.bar" } | ||
"opContextParamKeys": { path: "keys(fooKeys)" } | ||
) | ||
operation GetFoo { | ||
input: GetFooInput, | ||
output: GetFooOutput, | ||
errors: [GetFooError] | ||
} | ||
|
||
structure GetFooInput { | ||
fooKeys: FooObject, | ||
fooList: FooList, | ||
fooListObj: FooListObj, | ||
fooObj: FooObject, | ||
fooObjObj: FooObjectObject, | ||
fooString: String, | ||
} | ||
|
||
structure FooObject { | ||
bar: String | ||
} | ||
|
||
structure FooObjectObject { | ||
baz: FooObject | ||
} | ||
|
||
list FooList { | ||
member: String | ||
} | ||
|
||
list FooListObj { | ||
member: FooListObjMember | ||
} | ||
|
||
structure FooListObjMember { | ||
key: String | ||
} | ||
|
||
structure GetFooOutput {} | ||
|
||
@error("client") | ||
structure GetFooError {} |