Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

null scopes in ApiGatewayV2httpRequestContextAuthorizerJwtDescription #25

Closed
mattrjacobs opened this issue Aug 19, 2020 · 4 comments
Closed

Comments

@mattrjacobs
Copy link
Contributor

I am working on switching the payload type from 1.0 to 2.0 for an HTTP API I'm working on. When I did that with a stock Cognito JWT authorizer, I started receiving "scopes": null from my API Gateway. The definition in this crate is scopes: Vec<String>, so that doesn't work.

This appears to be a common input from API Gateway -> Lambda, as seen in these examples:

The aws-lambda-go repo defines this as Scopes []string json:"scopes"``.

I don't know enough about Go and the codegen you're doing to know if the problem is in the initial Go data structure or in the codegen.

@LegNeato
Copy link
Contributor

@mattrjacobs we need to mark that as omitempty on the go side or we need to map null to the default on the rust side.

@mattrjacobs
Copy link
Contributor Author

Thanks, I opened aws/aws-lambda-go#317

@mattrjacobs
Copy link
Contributor Author

This has been fixed and merged on the Go side, and I confirmed that the diff on the generated Rust side looks as expected:

-    pub scopes: Vec<String>,
+    pub scopes: Option<Vec<String>>,

There are other changes on the Go side as well, so I will let you decide when to do another sync, but this issue can now get closed once the sync is done. Thanks!

@LegNeato
Copy link
Contributor

LegNeato commented Jan 5, 2021

Thanks for the bug report and the PR! Will cut a release with this soon 🍻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants