Skip to content

fix: correct content negotiation 406/415 mapping#418

Merged
zachdaniel merged 1 commit intoash-project:mainfrom
vkryukov:issue-417
Mar 9, 2026
Merged

fix: correct content negotiation 406/415 mapping#418
zachdaniel merged 1 commit intoash-project:mainfrom
vkryukov:issue-417

Conversation

@vkryukov
Copy link
Contributor

@vkryukov vkryukov commented Mar 9, 2026

Summary

Fixes #417.

This corrects the JSON:API content-negotiation error mapping so that:

  • invalid or unsupported Content-Type returns 415 Unsupported Media Type
  • unacceptable Accept returns 406 Not Acceptable

It also updates the spec-compliance regression tests to assert the corrected HTTP statuses and the corresponding JSON:API error codes/titles.

Verification

  • mix test test/spec_compliance/content_negotiation_test.exs
  • mix test

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

This PR was created by Codex/GPT-5.4 and manually reviewed/verified by me.

Map invalid Content-Type requests to UnsupportedMediaType (415) and invalid Accept requests to UnacceptableMediaType (406). Update the spec compliance tests to assert the corrected statuses and JSON:API error codes/titles.
@zachdaniel zachdaniel merged commit 5e59c1c into ash-project:main Mar 9, 2026
23 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

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.

Content negotiation errors appear to map 406/415 in reverse

2 participants