我为S3设置了一个API网关集成,该集成调用ListBucket端点。这将返回类似XML的
<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>bucketname</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>foldername</Key>
<LastModified>2020-05-28T09:56:21.000Z</LastModified>
<Size>0</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>times/sporting.json</Key>
<LastModified>2020-06-02T09:57:23.000Z</LastModified>
<Size>14</Size>
<Owner>
<ID>ID</ID>
<DisplayName>ACCOUNT-NAME</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>key/test.json</Key>
<LastModified>2020-05-28T11:02:17.000Z</LastModified>
<Size>16</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>
是否有一种使用VTL映射模板将此响应转换为JSON的方法? XML似乎以字符串形式返回,并且JSONPath指令均未返回任何类似$inputRoot['?xml'] or
$ inputRoot.ListBucketResult`