Skip to content

Conversation

@andreer
Copy link
Member

@andreer andreer commented Dec 12, 2025

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Copy link
Contributor

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 pull request adds CBOR content negotiation support by moving the AcceptHeaderMatcher class to the public API and integrating it into the search request handling flow. The changes enable clients to request CBOR format responses via the HTTP Accept header.

Key Changes:

  • Moved AcceptHeaderMatcher from internal package to com.yahoo.net and made it public
  • Integrated Accept header parsing in SearchHandler to automatically set CBOR format when preferred
  • Updated comments in JsonRenderer to reflect that format determination now includes Accept header logic

Reviewed changes

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

Show a summary per file
File Description
vespajlib/src/main/java/com/yahoo/net/AcceptHeaderMatcher.java Changed package from com.yahoo.document.restapi.resource to com.yahoo.net and visibility from package-private to public
vespajlib/src/test/java/com/yahoo/net/AcceptHeaderMatcherTest.java Updated package declaration to match the new location
vespajlib/abi-spec.json Added public API specification for the newly exposed AcceptHeaderMatcher class
vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java Added import for the relocated AcceptHeaderMatcher class
container-search/src/main/java/com/yahoo/search/handler/SearchHandler.java Added setFormatFromAcceptHeader method to determine response format from Accept header when no explicit format parameter is provided
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java Updated comments to clarify that format is now set by SearchHandler based on both query parameter and Accept header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andreer andreer force-pushed the andreer/cbor-content-negotiation branch from cae71ab to 6d25b2f Compare December 14, 2025 08:04
@andreer
Copy link
Member Author

andreer commented Dec 14, 2025

fyi @vekterli im in yo repo stealin yo code

@andreer andreer marked this pull request as ready for review December 14, 2025 08:50
@andreer
Copy link
Member Author

andreer commented Dec 14, 2025

Question: should we care about setting Vary: Accept?

Copy link
Contributor

@johansolbakken johansolbakken left a comment

Choose a reason for hiding this comment

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

Nice, this looks good to me😊

Copy link
Member

@bjorncs bjorncs left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

4 participants