swagger-api/swagger-codegen

[Javascript] Problems on deserialize text type and on file response

開放

#3,297 建立於 2016年7月5日

 (5 則留言) (0 個反應) (0 位負責人)HTML (5,474 個分叉)batch import
Client: JavaScript/Node.jsIssue: Bughelp wanted

倉庫指標

星標
 (12,701 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Hi, I'm testing my api on the generated nodejs(javascript) client. I've found two problems, that break the client when called. First: when I've a call that return text/plain, SuperAgent initialize the body to {}, so data it's never null and doesn't verify the if condition, and in the end it gives an error. deserialize I've done a fix for my case, just adding this line in the if clauses "if (data == null || (returnType==='String' && Object.keys(data).length === 0 && data.constructor === Object))" but I think this is a bug and has to be correct

Second: I've a call where the response is a file file And this is fine on other language like java or ruby, but not on javascript. It gives this error: file2

Thanks in advance for support

I'm using Swagger-codegen version 2.2.0

貢獻者指南