Я создал swagger, используя модуль swagger-ui-express для моего узла js backend.
У меня есть конечная точка, которая возвращает файлы (pdf-doc или xlsx).
Когда я проверяю свою конечную точку на чванстве, он возвращает мне ответ 200 с всегда этим сообщением в теле «Нераспознанный тип ответа; отображение контента в виде текста. '
Это код моей конечной точки чванства.
![endpoint response image](https://i.stack.imgur.com/xC94n.png)
"/reports?typeDoc={typeDoc}&file={file}": {
"get": {
"tags": [
"Generate report"
],
"description": "",
"operationId": "",
"parameters": [
{
"name": "typeDoc",
"in": "path",
"description": "type of document",
"required": true,
"type": "string"
},
{
"name": "file",
"in": "path",
"description": "name of the file",
"required": true,
"type": "string"
}
],
"responses": {
"200":{
"description": "Report generated succefully. ",
"content":{
"application/octet-stream":{
"schema":{
"type": "string",
"format": "binary"}
}
}
},
"500": {
"description": "Error in zip file structure or typeDoc"
}
}
}
}