-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-apigatewayv2): Validation of apiMappingKey in ApiMappingProps is too strict #15948
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
Description
I currently have a an API mapping key in the form of common-rest-api. Using the API mapping CDK construct to create a mapping like this results in an error message: An ApiMapping key may contain only letters, numbers and one of $-_.+!*'()
Reproduction Steps
const mapping = new ApiMapping(this, 'api-mapping', {
api: this.api,
domainName: this.domainName,
apiMappingKey: 'key-with-multiple-hyphens',
});
What did you expect to happen?
The API mapping should be created without an error. In the console, there is in fact nothing that stops me from creating a mapping key with the string -test-.
What actually happened?
I get an error message saying An ApiMapping key may contain only letters, numbers and one of $-_.+!*'()
Other
The issue is the regex on this line, which only permits a single character of the ones mentioned above.
| const paramRe = '^[a-zA-Z0-9]*[-_.+!,$]?[a-zA-Z0-9]*$'; |
CDK version: 1.117.0
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1