aws / aws/aws-lambda-go

Small issue: CognitoEventUserPoolsMigrateUser request/response fields are not named

Open
#429 1 comment 1 reaction 0 assignees View on GitHub
type/ux
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
8h 18m
Merged PRs (30d)
1

Description

Other Cognito event structs look like:

```go
type CognitoEventUserPoolsPostAuthentication struct {
CognitoEventUserPoolsHeader
Request CognitoEventUserPoolsPostAuthenticationRequest `json:"request"`
Response CognitoEventUserPoolsPostAuthenticationResponse `json:"response"`
}
```

But `CognitoEventUserPoolsMigrateUser` is defined as:

```go
type CognitoEventUserPoolsMigrateUser struct {
CognitoEventUserPoolsHeader
CognitoEventUserPoolsMigrateUserRequest `json:"request"`
CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}
```

So instead of `event.Response.UserAttributes` you have to do either `event.UserAttributes` or `event.CognitoEventUserPoolsMigrateUserResponse.UserAttributes` which both look a bit weird to me and is a bit inconsistent with the other event definitions?

Is this intentional or just a miss?

My suggestion is to change the definition to:

```go
type CognitoEventUserPoolsMigrateUser struct {
CognitoEventUserPoolsHeader
Request CognitoEventUserPoolsMigrateUserRequest `json:"request"`
Response CognitoEventUserPoolsMigrateUserResponse `json:"response"`
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.