Skip to content

Update the template to expose the response context #67

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

PatrickDinh
Copy link
Collaborator

Update the template to expose the response context:

  • Add http status text to response context
  • Instead of using HttpInfo class, expose the response context directly.
    The reason for this change is that in utils-ts, I found that I need access to the raw binary returned from the http call. Currently, there are methods such as rawTransactionWithHttpInfo that return the HttpInfo (wrapper of the ResponseContext), there are some limitations:
  • when processing the response, if the response type isn't binary, the text is extracted from the response. This makes the binary stream unusable downstream. In utils-ts, I can't read the binary anymore.
  • HttpInfo is just a thin wrapper around ResponseContext, I think we should just expose the ResponseContext and the consumers have full control of how they want to use it.

@PatrickDinh PatrickDinh changed the base branch from main to spike/oas_clients May 2, 2025 01:37
@PatrickDinh PatrickDinh requested a review from aorumbayev May 2, 2025 01:37
@PatrickDinh PatrickDinh marked this pull request as ready for review May 2, 2025 01:38
@PatrickDinh PatrickDinh merged commit 3f553c2 into spike/oas_clients May 2, 2025
16 checks passed
@PatrickDinh PatrickDinh deleted the spike/oas-client-raw-response branch May 2, 2025 11:41
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