aws-sdk-js-v3 icon indicating copy to clipboard operation
aws-sdk-js-v3 copied to clipboard

Invalid regex displayed when wrong 'Name' parameter used

Open neophytte opened this issue 2 years ago • 1 comments

Describe the bug

When providing an invalid name, the output displays:

ValidationException: 1 validation error detected: Value 'aws.partner.TestBus' at 'name' failed to satisfy constraint: Member must satisfy regular expression pattern: aws.partner(/[.-_A-Za-z0-9]+){2,}

the regex displayed is invalid

Your environment

SDK version number

@aws-sdk/[email protected]

Is the issue in the browser/Node.js/ReactNative?

NestJS

Details of the browser/Node.js/ReactNative version

Paste output of npx envinfo --browsers or node -v or react-native -v Need to install the following packages: envinfo Ok to proceed? (y) y

Browsers: Chrome: 93.0.4577.82 Firefox: 78.7.0esr

$ node -v v14.15.1

Steps to reproduce

https://stackoverflow.com/questions/68826483/aws-eventbridge-name-param

Observed behavior

As listed above

Expected behavior

A valid regex displayed

neophytte avatar Sep 21 '21 10:09 neophytte

Hi @neophytte, thanks for opening this issue. That regular expression it is actually a valid one, it is just that the forward slash is not coming with the escaping character () when printed out into the console. It is complaining about the name being wrong because the name should be at least something as follow:

aws.partner/test/partner

Lets break down the regular expression:

  • aws.partner: means it should start with "aws.partner"
  • (/[.-_A-Za-z0-9]+){2,}: means that you should have at least 2 group of a forward slash followed by a string that contains lower or upper case letters, or numbers, or dots, and this string can be of any length. Example: /firstgroup/secondgroup

So, at the end you will get something like this: aws.partner/firstgroup/secondgroup.

If you have any question just let me know.

Thanks!

yenfryherrerafeliz avatar Aug 08 '22 16:08 yenfryherrerafeliz

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] avatar Aug 16 '22 00:08 github-actions[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

github-actions[bot] avatar Sep 03 '22 00:09 github-actions[bot]