我需要在Python3.7脚本中使用boto3 (版本1.9.139)通过aws api-gateway中的swagger 2.0定义导入并更新rest-api。问题是api-gateway忽略了基本路径参数。
我知道这是“默认”行为(来自boto3文档、basePath=ignore)。然后关于文档,我需要设置basePath=prepend。
我的代码:
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()
)我在swagger-def.yaml中的basePath:
basePath: /dev/v1api_response正常,没有警告或错误。成功更新api-网关,但忽略basePath。
任何想法都是值得感谢的。
发布于 2019-09-04 00:44:38
URL参数可以区分大小写。请尝试将"basepath“作为记录的here
https://stackoverflow.com/questions/56468838
复制相似问题