-
Notifications
You must be signed in to change notification settings - Fork 105
Process Operation Context Params in Endpoints #1379
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e18086e
Process OperationContextParams in RuleSetParameterFinder
trivikr e8e2efb
Populate Operation Context Params in Endpoint Instruction Provider
trivikr 0d5f950
Use text-block for operation context param values
trivikr fdcb565
Populate name and value when processing Operation Context Params
trivikr bb72d3a
Search for Operation Context Params trait on OperationShape
trivikr f022101
Add tests for Operation Context Params Identifier and SubExpression
trivikr 1e7e865
Use map for hash wildcard expressions
trivikr b969772
Add tests for Operation Context Params List Wildcard Expressions
trivikr 25dfe68
Add a mapper if Object values need to be processed
trivikr 1782bdb
Add tests for Operation Context Params Hash Wildcard Expressions
trivikr 459774a
Add tests for JMESPath keys
trivikr a7c13a7
Remove redundant variable operationContextParamsTrait
trivikr 9d7af21
Remove no-op map from OperationContextParamValues
trivikr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.