swift-aws-lambda-runtime
swift-aws-lambda-runtime copied to clipboard
ClientContext should be a type, not String
Expected behavior
The ClientContext is often of well known shape:

It should handle the typing more gracefully I think, see docs: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html
See also: https://github.com/swift-server/swift-aws-lambda-runtime/pull/167#discussion_r489236665 for discussion on this
Actual behavior
It's a String today:
let clientContext: String?
Still valid for v2
Here is the Rust documentation https://docs.aws.amazon.com/lambda/latest/dg/rust-context.html and implementation https://github.com/awslabs/aws-lambda-rust-runtime/blob/baf3653402930d74500dde0e8a2d2264407d3f4f/lambda-runtime/src/types.rs#L16
v2 : line to change https://github.com/swift-server/swift-aws-lambda-runtime/blob/36dadf9c2695f660a5d8f96ad0685f48b0ad3ca5/Sources/AWSLambdaRuntime/LambdaContext.swift#L30
Fixed by https://github.com/swift-server/swift-aws-lambda-runtime/pull/539
merged