Skip to content

CompleteMultipartUploadCommand missing IfMatch types #6795

@DarthCoder117

Description

@DarthCoder117

Checkboxes for prior research

Describe the bug

Trying to use CompleteMultipartUploadCommand with conditional requests I noticed the IfMatch and IfNoneMatch fields are visible in the API reference, but not available in the actual package.

I assumed it must be that my SDK is outdated, so I tried updating to the latest version but nothing changed.

I also checked to see that the same issue affects the PutObjectCommand as well.

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/CompleteMultipartUploadCommand/
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand/

Regression Issue

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

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.11.1

Reproduction Steps

Try to instantiate a CompleteMultipartUploadCommand using either IfMatch or IfNoneMatch

new CompleteMultipartUploadCommand({
  Bucket: "some-bucket",
  Key: "some/key",
  UploadId: "1234567890",
  IfNoneMatch: "*",
});

Observed Behavior

You get type errors:

No overload matches this call.
  Overload 1 of 2, '(input: CompleteMultipartUploadCommandInput): CompleteMultipartUploadCommand', gave the following error.
    Object literal may only specify known properties, and 'IfNoneMatch' does not exist in type 'CompleteMultipartUploadCommandInput'.
  Overload 2 of 2, '(__0_0: CompleteMultipartUploadCommandInput): CompleteMultipartUploadCommand', gave the following error.
    Object literal may only specify known properties, and 'IfNoneMatch' does not exist in type 'CompleteMultipartUploadCommandInput'.ts(2769)

Expected Behavior

You shouldn't get type errors.

Possible Solution

No response

Additional Information/Context

I believe this bug was likely not noticed because using a separate input object dodges the type error.

This works fine:

const input = {
  Bucket: "some-bucket",
  Key: "some/key",
  UploadId: "1234567890",
  IfNoneMatch: "*",
};
new CompleteMultipartUploadCommand(input);

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions