Skip to content

Fix ResponseHandler for return of generic BinaryData types #45299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

samvaity
Copy link
Member

Description

This PR fixes the ResponseHandler for the return of generic BinaryData types. Earlier we were assuming the BinaryData return subtype did not include any generics, this fixes and currently adds support for List.class.

@samvaity samvaity self-assigned this May 12, 2025
@samvaity samvaity marked this pull request as ready for review May 13, 2025 16:33
@Copilot Copilot AI review requested due to automatic review settings May 13, 2025 16:33
Copy link
Contributor

@Copilot 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 PR fixes the ResponseHandler to properly support generic BinaryData types, specifically responses encapsulated as a List.

  • Added runtime checks for generic return types and delegated handling to a new helper method when a List is detected.
  • Updated the test service interface and implementation to verify correct behavior for List responses.

Reviewed Changes

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

File Description
sdk/clientcore/annotation-processor/src/main/java/io/clientcore/annotation/processor/utils/ResponseHandler.java Enhanced generic BinaryData detection and added handleDeclaredTypes for declared type responses
sdk/clientcore/annotation-processor-test/src/main/java/io/clientcore/annotation/processor/test/implementation/SpecialReturnBodiesService.java Added a new endpoint for returning a Response<List> along with related annotations
sdk/clientcore/annotation-processor-test/src/main/java/io/clientcore/annotation/processor/test/SpecialReturnBodiesServiceImpl.java Implemented deserialization and error handling for the List response case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants