-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 PutBucketMetricsConfiguration Receiving MalformedXML Response with API Example #1334
Comments
Thanks for reporting this issue @bflad. I investigated this issue and it looks like this API requires the It looks like the SDK's code generation for S3's protocol drop's the modeled As a rough workaround you could write the request body directly in a build handler to workaround this issue until the SDK fixes this bug. // PUT S3 Bucket Metrics Configuration
_, err := svcDebug.PutBucketMetricsConfigurationWithContext(context.Background(), &s3.PutBucketMetricsConfigurationInput{
Bucket: aws.String(bucket),
Id: aws.String(metricsID),
MetricsConfiguration: &s3.MetricsConfiguration{
Id: aws.String(metricsID),
},
}, func(r *request.Request) {
r.Handlers.Build.PushBack(func(req *request.Request) {
req.SetReaderBody(bytes.NewReader([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<MetricsConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Id>EntireBucket</Id>
</MetricsConfiguration>`)))
})
})
if err != nil {
log.Printf("Error putting S3 bucket metrics configuration: %s", err)
} |
Fixes a bug with the SDK's generation of services using the REST XML protocol not annotating shape references with the XML Namespace attribute. Fix aws#1334
Fixes a bug with the SDK's generation of services using the REST XML protocol not annotating shape references with the XML Namespace attribute. The XML Namespace URI was incorrectly being limited to the top level API shape, where it should of applied to all levels. Fix #1334
Hi @bflad thanks for reporting this issue. I've merged in a fix that corrects this issue for S3 API operations. This change is available on tip and will be included in the SDK's next release. |
Version of AWS SDK for Go?
1.8.39
Version of Go (
go version
)?go version go1.8.3 darwin/amd64
What issue did you see?
Trying to use
s3.PutBucketMetricsConfiguration
with the simplest example of the API documentation (metrics for the whole bucket, no filters -- https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html#examples) is always receiving MalformedXML response, even though the request seems to match the documentation.Steps to reproduce
https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html#examples shows request as:
The text was updated successfully, but these errors were encountered: