Description
The isBlob property of a response is derived from its content type only. It disregards the format: binary that could be declared on the response schema.
This means that Orval has to maintain a list of ALL content types that are binary. I'd argue that a shortlist of well known binary content types (such as zip, octet-stream, pdf etc.) does help with openapi specs that may not be perfectly formed, but we should also check for {"type": "string", "format": "binary"} in the response schema to decide whether to enable the isBlob property.
I ran into this issue while trying to serve a .docx export of a document (see the response object below)
If you agree, I'd be happy to make a PR.
Output client
axios
Configuration (orval.config)
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
Description
The isBlob property of a response is derived from its content type only. It disregards the
format: binarythat could be declared on the response schema.This means that Orval has to maintain a list of ALL content types that are binary. I'd argue that a shortlist of well known binary content types (such as zip, octet-stream, pdf etc.) does help with openapi specs that may not be perfectly formed, but we should also check for
{"type": "string", "format": "binary"}in the response schema to decide whether to enable the isBlob property.I ran into this issue while trying to serve a
.docxexport of a document (see the response object below)If you agree, I'd be happy to make a PR.
Output client
axios
Configuration (orval.config)