Skip to content

fix: honor request content types - #6463

Open
lucasjia-aws wants to merge 1 commit into
aws:master-v2from
lucasjia-aws:fix/5006-schema-builder-content-type-v2
Open

lucasjia-aws wants to merge 1 commit into
aws:master-v2from
lucasjia-aws:fix/5006-schema-builder-content-type-v2

Conversation

@lucasjia-aws

@lucasjia-aws lucasjia-aws commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DeserializerWrapper currently forces its configured Accept type for both request and response deserialization. As a result, valid JSON or CSV requests can be incorrectly parsed as NPY data.

This change makes input deserializers honor the caller-provided Content-Type while preserving the existing output behavior that uses the configured Accept type when model servers return misleading response headers such as text/html.

Testing

  • Added NumPy input regressions for JSON and CSV payloads.
  • Added output coverage proving that a misleading text/html response still uses the configured NPY deserializer.
  • Ran the affected schema-builder suite: 12 passed.
  • Black, Flake8, security exposure checks, and git diff --check passed.
  • Built the SageMaker 2.257.7 wheel and source distribution successfully.

Related change

The companion V3 fix is published on #6462.

Fixes #5006

Pass caller-provided content types to request deserializers so JSON and CSV NumPy payloads are decoded correctly. Keep response deserializers pinned to configured Accept types for model servers that return misleading headers.

Fixes aws#5006

This branch was successfully deployed

1 active deployment
auto-approve — 2407cf08 Deployed Oct 13, 2026 by lucasjia-aws via wait-for-approval #255
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