Skip to content

[s3-aws] optional_object_attributes for ListObjectsV2Input should be Option #291

@tmlye

Description

@tmlye

I'm having a bit of trouble with using the ListObjectsV2Input struct. The optional_object_attributes field is not an Option at the moment, so the natural thing to do is to use Vec::new(). However, the S3 API return a 400 if this header is specified but empty:

<Error><Code>InvalidArgument</Code><Message>Invalid attribute name specified.</Message><ArgumentName>x-amz-optional-object-attributes</ArgumentName><ArgumentValue></ArgumentValue>

My workaround is to just add something inside that I don't actually need:

req.input.optional_object_attributes = vec![
            OptionalObjectAttributes::from_static(OptionalObjectAttributes::RESTORE_STATUS)
        ];

This allows the request to go through, but it would be nicer to make this field Option so we can set it to None and omit the header in the request.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions