fix: skip importing response types for binary endpoints#30
Merged
santiagomed merged 1 commit intomainfrom Mar 13, 2026
Merged
Conversation
Operations that return application/octet-stream (binary data) don't have response model classes generated in models.j2, since those templates only generate models for application/json responses. However, the client_class.j2 templates were importing response types for ALL operations with 200/201 responses, causing import errors like: Module '"./models.js"' has no exported member 'MediaDownloadResponse' This fix adds a check in both TypeScript and Python client_class.j2 templates to only import response types for operations that actually return JSON content, matching the behavior of the models templates. Binary response operations (like chatMediaDownload) correctly use ArrayBuffer (TypeScript) or bytes (Python) as return types and don't need imported response model types.
tcaldwell-x
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Operations that return
application/octet-stream(binary data) likechatMediaDownloaddon't have response model classes generated inmodels.j2, since those templates only generate models forapplication/jsonresponses.However, the
client_class.j2templates were importing response types for ALL operations with 200/201 responses, causing build errors like:Solution
Added a check in both TypeScript and Python
client_class.j2templates to only import response types for operations that actually return JSON content, matching the behavior of the models templates.Binary response operations correctly use
ArrayBuffer(TypeScript) orbytes(Python) as return types and don't need imported response model types.Testing