swift-aws-lambda-runtime icon indicating copy to clipboard operation
swift-aws-lambda-runtime copied to clipboard

ClientContext should be a type, not String

Open ktoso opened this issue 5 years ago • 1 comments

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?

ktoso avatar Sep 17 '20 08:09 ktoso

Still valid for v2

sebsto avatar Nov 07 '24 14:11 sebsto

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

sebsto avatar Jul 26 '25 05:07 sebsto

v2 : line to change https://github.com/swift-server/swift-aws-lambda-runtime/blob/36dadf9c2695f660a5d8f96ad0685f48b0ad3ca5/Sources/AWSLambdaRuntime/LambdaContext.swift#L30

sebsto avatar Jul 26 '25 05:07 sebsto

Fixed by https://github.com/swift-server/swift-aws-lambda-runtime/pull/539

sebsto avatar Jul 31 '25 16:07 sebsto

merged

sebsto avatar Aug 04 '25 05:08 sebsto