-
Hi all, I have the folllowing code which is generated by NSwag for TS clients:
The problem here is that due to the line result400 = User.fromJS(resultData400);, the _responseText is not returned when exception is thrown. It is returning result400 which is an empty object. This does not always happen, in the same generated file the ".fromJS" is ommitted and uses the _responseText as the value.
How can I make the first set of code same as the second one? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found it just as I finished opening the question. It is due to the possible return types of my API where I had a BadRequest. After removing this, it returned the proper result |
Beta Was this translation helpful? Give feedback.
Found it just as I finished opening the question. It is due to the possible return types of my API where I had a BadRequest. After removing this, it returned the proper result