Add support for `operationContextParams` Endpoints trait (#3755)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> We have to support the new [`operationContextParams` trait](https://smithy.io/2.0/additional-specs/rules-engine/parameters.html#smithy-rules-operationcontextparams-trait) for endpoint resolution. This trait specifies JMESPath expressions for selecting parameter data from the operation's input type. ## Description <!--- Describe your changes in detail --> * Add codegen support for the [JMESPath `keys`](https://jmespath.org/specification.html#keys) function (required by the trait [spec](https://smithy.io/2.0/additional-specs/rules-engine/parameters.html#smithy-rules-operationcontextparams-trait)) * Add codegen support for the trait itself. This is achieved by generating `get_param_name` functions for each param specified in `operationContextParams`. These functions pull the data out of the input object and it is added to the endpoint params in the `${operationName}EndpointParamsInterceptor` ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Updated the existing test suite for JMESPath codegen to test the `keys` function. Updated the existing EndpointsDecoratorTest with an `operationContextParams` trait specifying one param of each supported type to test the codegen. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Loading
Please register or sign in to comment