(aws-events): `Match.exists()` and `Match.doesNotExist()` is swapped out
Describe the issue
I think the documentation of both functions is somehow swapped.
Exists documentation explains:
Matches when the field is absent from the JSON of the event.
Doesn't exist documentation explains:
Matches when the field is present in the JSON of the event.
Either I get the functions completely wrong or the docs are wrong.
Also from the code
/**
* Matches when the field is absent from the JSON of the event
*/
public static exists(): string[] {
return this.fromObjects([{ exists: true }]);
}
/**
* Matches when the field is present in the JSON of the event
*/
public static doesNotExist(): string[] {
return this.fromObjects([{ exists: false }]);
}
I understand it should be vice-versa.
Links
Does not exist: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Match.html#static-doeswbrnotwbrexist
Exist: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events.Match.html#static-exists
Yeah, these should be swapped. Good catch! Thanks for calling it out @AlessandroVol23. Would you like to submit a PR to fix this yourself?
If it's ok I'd like to pick this up 👍
Go for it @HBobertz !
If it's ok I'd like to pick this up 👍
Yes please do that :)! I checked it out briefly but I don't have the repo running locally so it would take me some more time 😉
Thanks!
When I went to pick this up I thought there might be an actual logic change to this 😅, or at least that it'd be more involved. Regardless change is out
@HBobertz great, thanks! Be sure to remember to have fixes or closes before the issue number so that the issue gets autoclosed on merge like so: fixes #23469 🙂
⚠️COMMENT VISIBILITY WARNING⚠️
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. If you wish to keep having a conversation with other community members under this issue feel free to do so.