Commit 7ece1a2
authored
fix: skip importing response types for binary endpoints (#30)
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.1 parent db99bee commit 7ece1a2
2 files changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | 28 | | |
31 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
0 commit comments