0
votes

I need to import and then update rest-apis via swagger 2.0 definition in aws api-gateway using boto3 (version 1.9.139) in a python 3.7 script. The problem is that api-gateway ignores the base path parameter.

I understand that it is the "default" behavior (from boto3 docs, basePath=ignore). Then regarding the documentation, I need to set basePath=prepend.

My code:


apiClient = boto3.client('apigateway', awsregion)
api_response = apiClient.put_rest_api(
    restApiId= api_id,
    mode='overwrite',
    failOnWarnings=True,
    parameters={
        'basePath': 'prepend',
        'endpointConfigurationTypes': 'REGIONAL'
    },
    body=open('swagger-def.yaml', 'rb').read()
)

My basePath in swagger-def.yaml:

basePath: /dev/v1

The api_response is ok, there are no warnings or errors. The api-gateway is updated succefully, but the basePath is ignored.

Any ideas are appreciated.

1

1 Answers

0
votes

The URL parameter may be case sensitive. Please try "basepath" as documented here