Skip to content

Deprecate use_msgpack in favor of Accept header#504

Open
ltrottier-yelp wants to merge 2 commits into
Yelp:masterfrom
ltrottier-yelp:u/ltrottier/deprecate_use_msgpack
Open

Deprecate use_msgpack in favor of Accept header#504
ltrottier-yelp wants to merge 2 commits into
Yelp:masterfrom
ltrottier-yelp:u/ltrottier/deprecate_use_msgpack

Conversation

@ltrottier-yelp
Copy link
Copy Markdown

Summary

  • Adds a DeprecationWarning when use_msgpack is used in _request_options
  • Guides users to use headers={"Accept": "application/msgpack"} directly instead

Context

Part of a multi-repo change to support msgpack content negotiation via standard HTTP headers:

  1. bravado-core Use standard Content-Type header for msgpack bravado-core#419 — marshal/unmarshal based on Content-Type header
  2. This PR — deprecate the now-redundant use_msgpack shorthand

use_msgpack only ever set Accept: application/msgpack. With the new standard header approach, users can set both Content-Type and Accept directly, making use_msgpack redundant.

Test plan

  • Existing test updated to verify DeprecationWarning is emitted
  • All construct_request tests passing

The use_msgpack request option is now redundant since clients can set
the Accept header directly via _request_options or default_request_options.
Emit a DeprecationWarning guiding users to the standard header approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread bravado/client.py Outdated
Co-authored-by: milki <milki@yelp.com>
@ltrottier-yelp ltrottier-yelp requested a review from ymilki May 13, 2026 16:55
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.

2 participants