Aws-cdk: Cannot call request validator options multiple times.

Created on 27 Apr 2020  路  1Comment  路  Source: aws/aws-cdk

Calling 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: Bug Report

@aws-cdaws-apigateway bug efforsmall p2

Most helpful comment

Thanks for filing this @durja. This is, in fact, a bug on the CDK.

You can workaround this by using the requestValidator property.

>All comments

Thanks for filing this @durja. This is, in fact, a bug on the CDK.

You can workaround this by using the requestValidator property.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

v-do picture v-do  路  3Comments

ababra picture ababra  路  3Comments

peterdeme picture peterdeme  路  3Comments

PaulMaddox picture PaulMaddox  路  3Comments

artyom-melnikov picture artyom-melnikov  路  3Comments