Skip to content

XML Parsing mismatch in ListStorageLensConfiguration #2801

Closed as not planned
Closed as not planned
@ViBiOh

Description

Acknowledgements

Describe the bug

The mapping of s3control.ListStorageLensConfigurations is not aligned with the response from the API.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

When I request s3control.ListStorageLensConfigurations I get the results in StorageLensConfigurationList.

Current Behavior

When I request s3control.ListStorageLensConfigurations, StorageLensConfigurationList is always empty.

Payload response looks like this

<ListStorageLensConfigurationResult xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/">
  <StorageLensConfiguration>
    <StorageLensArn>arn:aws:s3:eu-west-3:XXXX:storage-lens/vibioh-test</StorageLensArn>
    <Id>vibioh-test</Id>
    <HomeRegion>eu-west-3</HomeRegion>
    <IsEnabled>true</IsEnabled>
  </StorageLensConfiguration>
</ListStorageLensConfigurationResult>

Reproduction Steps

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/s3control"
	"github.com/aws/smithy-go/logging"
)

func main() {
	cfg, err := config.LoadDefaultConfig(
		context.Background(),
		config.WithRegion("YOUR_REGION_HERE"),
		config.WithSharedConfigProfile("YOUR_PROFILE_HERE"),
		config.WithLogger(logging.LoggerFunc(func(_ logging.Classification, format string, v ...interface{}) {
			fmt.Printf(format, v...)
		})),
		config.WithClientLogMode(aws.ClientLogMode(aws.LogRequestWithBody|aws.LogResponseWithBody)),
	)
	if err != nil {
		log.Fatalf("unable to load SDK config: %s", err)
	}

	client := s3control.NewFromConfig(cfg)
	payload, err := client.ListStorageLensConfigurations(
		context.Background(), &s3control.ListStorageLensConfigurationsInput{
			AccountId: aws.String("YOUR_AWS_ACCOUNT"),
		},
	)
	if err != nil {
		panic(err)
	}

	fmt.Printf("\n%s\n", payload.StorageLensConfigurationList)
}

Possible Solution

Remove the extra List from here (but it's codegen so I don't know where to change the exact config)

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

require (
	github.com/aws/aws-sdk-go-v2 v1.31.0
	github.com/aws/aws-sdk-go-v2/config v1.27.36
	github.com/aws/aws-sdk-go-v2/service/s3control v1.48.0
	github.com/aws/smithy-go v1.21.0
)

Compiler and Version used

go1.23

Operating System and version

macOS 14.6.1 (23G93)

Metadata

Assignees

Labels

bugThis issue is a bug.duplicateThis issue is a duplicate.p3This is a minor priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions