此问题是由于AWS API Gateway API v1版本列表与v2版本列表返回数据的不同格式导致的。要解决这个问题,可以使用以下代码示例:
import boto3
client = boto3.client('apigateway')
response = client.get_rest_apis()
for api in response['items']: print(api['name'])
import boto3
client = boto3.client('apigatewayv2')
response = client.get_apis()
for api in response['Items']: print(api['Name'])
通过使用正确的API版本来列出API,可以解决AWS API Gateway上列出API的v1和v2版本的API返回不同的数据的问题。