You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: handle binary responses based on OpenAPI spec
Detect binary response types directly from the OpenAPI responses field
in templates (no extra Rust field needed).
Template changes:
- TypeScript: Check for 'application/octet-stream' in responses content,
pass 'binary: true' to request(), return ArrayBuffer
- Python: Check for 'application/octet-stream' in responses content,
return response.content as bytes
The binary check is derived at template render time from:
operation.responses['200'].content['application/octet-stream']
Supported binary content types:
- application/octet-stream
This provides:
- Better type safety (ArrayBuffer/bytes return types)
- No runtime content-type parsing overhead
- Correct IDE autocomplete and type inference
- No redundant data in the operation model
* @param body {%ifoperation.request_body.contentandoperation.request_body.content["application/json"] andoperation.request_body.content["application/json"].schemaandoperation.request_body.content["application/json"].schema.description%}{{ operation.request_body.content["application/json"].schema.description }}{%else%}Request body{%endif%}
119
119
{%endif%}
120
-
* @returns {Promise<{%ifoperation.responsesand"200"inoperation.responsesoroperation.responsesand"201"inoperation.responses%}{{ operation.class_name }}Response{%else%}any{%endif%}>} Promise resolving to the API response, or raw Response if requestOptions.raw is true
120
+
* @returns {Promise<{%ifoperation.responsesand (
121
+
("200"inoperation.responsesandoperation.responses["200"].contentand"application/octet-stream"inoperation.responses["200"].content) or
) %}ArrayBuffer{%elifoperation.responsesand"200"inoperation.responsesoroperation.responsesand"201"inoperation.responses%}{{ operation.class_name }}Response{%else%}any{%endif%}>} Promise resolving to the API response{%ifoperation.responsesand (
124
+
("200"inoperation.responsesandoperation.responses["200"].contentand"application/octet-stream"inoperation.responses["200"].content) or
0 commit comments