Skip to content

LambdaRequest seems to missing resource field #307

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

Closed
MathiasKoch opened this issue Mar 16, 2021 · 3 comments · Fixed by #426
Closed

LambdaRequest seems to missing resource field #307

MathiasKoch opened this issue Mar 16, 2021 · 3 comments · Fixed by #426
Assignees
Labels
bug Something isn't working

Comments

@MathiasKoch
Copy link

ApiGateway {
path: Cow<'a, str>,
#[serde(deserialize_with = "deserialize_method")]
http_method: http::Method,
#[serde(deserialize_with = "deserialize_headers")]
headers: http::HeaderMap,
#[serde(default, deserialize_with = "deserialize_multi_value_headers")]
multi_value_headers: http::HeaderMap,
#[serde(deserialize_with = "nullable_default")]
query_string_parameters: StrMap,
#[serde(default, deserialize_with = "nullable_default")]
multi_value_query_string_parameters: StrMap,
#[serde(default, deserialize_with = "nullable_default")]
path_parameters: StrMap,
#[serde(default, deserialize_with = "nullable_default")]
stage_variables: StrMap,
body: Option<Cow<'a, str>>,
#[serde(default)]
is_base64_encoded: bool,
request_context: ApiGatewayRequestContext,

Seems to be missing a resource field?
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/682a17a7683c34d23d6f70416f21e7f65671885c/types/aws-lambda/trigger/api-gateway-proxy.d.ts#L89-L102

This causes my event to fail serializing, rendering the entire lambda-http crate useless?

@MathiasKoch
Copy link
Author

MathiasKoch commented Mar 16, 2021

It also seems like ApiGatewayRequestContext is missing a few fields, as per the document linked in the code: See context-variable-reference for more detail.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ad2166e25bc7b95a8cdbdde41a01ce0b63313809/types/aws-lambda/common/api-gateway.d.ts#L22-L50

Obvious solution would probably be to copy the working types generated from https://github.com/LegNeato/aws-lambda-events/blob/master/aws_lambda_events/src/generated/apigw.rs

@bahildebrand bahildebrand added the bug Something isn't working label Mar 17, 2021
@bahildebrand
Copy link
Contributor

Agreed this looks like an issue. Would you mind creating a toy example to recreate your issue, and I can take a look at it?

@duaneking
Copy link

This is blocking basic functionality for many calls. Is somebody already working on this? Is there a fix planned? This makes this library unusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants