You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CognitoEventUserPoolsPreTokenGenV2 deserialization error when groupConfiguration is null #1129
Cognito's pre-token v2 hook can sometimes receive a null groupConfiguration field value. The cognito documentation includes example JSON rather than schema, so it's not clear whether this is a cognito bug or not. But it definitely happens at runtime for some user pools.
In any case, the rust structure fails to deserialize the event with
PreTokenGenerationV2_0 failed with error failed to deserialize the incoming data into the function's payload type: [request.groupConfiguration] request.groupConfiguration: invalid type: null, expected struct GroupConfiguration at line 1 column 835
In any case, the obvious backwards-compatible fix is to add #[serde(default)] to the field. Looks like maybe that was the intent and it just got missed on that field? Happy to test the fix / send a PR.
PR sent. i had to do a little more than "serde(default)", but it follows the pattern of other fields nearby. i verified the patch in my own cognito app (with a V2 pre-token trigger).
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
Activity
jlizen commentedon Mar 17, 2026
Adding the default is good, thanks!
fix handling of null groupConfiguration
jct-tympanon commentedon Mar 18, 2026
PR sent. i had to do a little more than "serde(default)", but it follows the pattern of other fields nearby. i verified the patch in my own cognito app (with a V2 pre-token trigger).
consolidate nullish deserializers.
fix handling of null groupConfiguration (#1130)
github-actions commentedon Mar 19, 2026
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
jlizen commentedon Mar 19, 2026
Fix has been released:
https://crates.io/crates/aws_lambda_events/1.1.2