Skip to content

Conversation

peterrsongg
Copy link
Contributor

@peterrsongg peterrsongg commented Aug 25, 2025

Description

Motivation and Context

Fixes issue #3971

Testing

Dry run passed + integ test added
DRY_RUN-c100ffac-7e3d-4365-bad7-2a70381f444c

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

{
"CannedACL":{
"injectXmlUnmarshallCode" :[
"return _cannedACL != null && _cannedACL != S3CannedACL.NoACL;"
Copy link
Contributor Author

@peterrsongg peterrsongg Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I went with this approach instead of excluding the member and then moving it to custom code is because doc updates wouldn't be generated in this case.

I may go back and update some of the customization.json entries to follow this approach where appropriate.

In this case the name injectXmlUnmarshallCode isn't really accurate anymore, but I just left it as such.

@GarrettBeatty GarrettBeatty requested a review from Copilot August 26, 2025 01:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #3971 where initiating multipart uploads in S3 would fail with a bad request error when the CannedACL property was set to NoACL. The fix prevents the ACL property from being included in requests when explicitly set to NoACL.

  • Adds custom unmarshall logic to exclude NoACL from XML serialization
  • Modifies code generation templates to support custom unmarshall code injection
  • Adds integration test to prevent regression

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/test/Services/S3/IntegrationTests/MultipartUploadTests.cs Integration test verifying multipart upload works with NoACL
generator/ServiceModels/s3/s3.customizations.json Adds custom unmarshall code for CannedACL property
generator/ServiceClientGeneratorLib/Generators/SourceFiles/StructureGenerator.tt Updates template to support custom unmarshall code
generator/ServiceClientGeneratorLib/Generators/SourceFiles/StructureGenerator.cs Generated code for structure template
Multiple generator files Generated code updates for marshallers and base classes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dscpinheiro dscpinheiro merged commit 8a3c7eb into development Aug 26, 2025
3 checks passed
@dscpinheiro dscpinheiro deleted the petesong/impu-s3 branch August 26, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants