Skip to content

S3: return ListPartsResult as the ListParts XML root - #10571

Open
tonypottera24 wants to merge 1 commit into
getmoto:masterfrom
tonypottera24:fix/s3-listparts-result-wrapper
Open

tonypottera24 wants to merge 1 commit into
getmoto:masterfrom
tonypottera24:fix/s3-listparts-result-wrapper

Conversation

@tonypottera24

Copy link
Copy Markdown

ListParts currently returns HTTP 200 with a ListPartsResponse XML root. S3 requires ListPartsResult. AWS SDK for Rust 1.154.0 rejects the unexpected root and surfaces an unhandled service error without a modeled error code or message, even for an empty multipart upload. Boto3 accepts the response, so assertions on its parsed result do not catch the mismatch.

Add the existing model-extra resultWrapper setting for ListParts, following the approach used for CompleteMultipartUpload in #10056. Extend the existing multipart-list test to inspect the raw XML on every ListParts response; its existing scenarios cover empty uploads, uploaded parts and pagination. Storage, authorization, error responses and the shared serializer are unchanged.

Validation on Python 3.12.3:

  • The extended existing test fails on unmodified master because the root is ListPartsResponse.
  • make lint passes (ruff 0.14.10, formatting and mypy).
  • Server-mode multipart suite: 41 passed, 16 skipped.
  • S3 and selected serialization suites: pytest -q tests/test_s3 tests/test_core/test_serialize.py tests/test_core/test_response_serialization.py — 584 passed, 5 skipped, 2 xfailed.

These are local Moto tests; no real AWS requests were made.

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.

1 participant