Cannot call request validator options multiple times.
See original GitHub issueCalling the constructor for RequestValidatorOptions multiple times gives an error
There is already a Construct with name ‘validator’ in RestApi
Reproduction Steps
`
resource1.add_method(
http_method='POST',
integration=xxxIntegration,
request_parameters={
'method.request.header.passcode': True,
'method.request.header.message': True
},
request_validator_options=_apigw.RequestValidatorOptions(validate_request_parameters=True, request_validator_name='POST-r1-validator')
)
resource2.add_method(
http_method='POST',
integration=yyyIntegration,
request_parameters={
'method.request.header.passcode': True,
'method.request.querystring.id': True
},
request_validator_options=_apigw.RequestValidatorOptions(validate_request_parameters=True,request_validator_name='POST-r2-validator')
)
`
Error Log
Environment
- **CLI Version :1.35.1
- **Framework Version:1.35.1
- **OS : Mac Mojave
- **Language : Python
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:22
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Request Validation in AWS CDK - Stack Overflow
While trying your solution, I think I stumbled on it. I was using a variable string in the construct ID and that caused...
Read more >class RequestValidator (construct) · AWS CDK
Indicates whether to validate request parameters. restApi. Type: IRestApi. The rest API that this model is part of. The reason we ...
Read more >Validation - Laravel - The PHP Framework For Web Artisans
However, many applications receive XHR requests from a JavaScript powered frontend. When using the validate method during an XHR request, Laravel will not ......
Read more >Validation - Laravel Livewire
Customize Error Message & Attributes ; 2 · 3 ; 7 $validatedData = $this->validate(. 8 ; 10 'email.required' => 'The :attribute cannot be...
Read more >Custom Validators — FluentValidation documentation
At the moment, our custom validator always returns the message “The list contains too many items” if validation fails. Instead, let's change the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for filing this @durja. This is, in fact, a bug on the CDK.
You can workaround this by using the
requestValidator
property.This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.