NSwag Studio 13.7.1 generating FileResponse return types

Created on 11 Sep 2020  路  3Comments  路  Source: RicoSuter/NSwag

When launching NSwag Studio a bit ago, I was prompted to upgrade from 13.7.0 to 13.7.1. I went ahead and did this, then generated CSharp Client code from OpenAPI/Swagger Specification. This changes return types from something like this:

/// <returns>Success</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ProductFavorite>> GetProductFavoriteAllAsync();

to

/// <returns>Success</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
System.Threading.Tasks.Task<FileResponse> GetProductFavoriteAllAsync();

I have since uninstalled 13.7.1 and reinstalled 13.7.0 to resolve the issue. Let me know if you need any more information.

Most helpful comment

I think we need to revert that.. the idea was that if the response is not only json then we return fileresult for max flexibility. Bad idea probably.. will be reverted on monday

All 3 comments

I ran into the same issue but while generating a TypeScript client. All return types were changed to FileResponse.

I think we need to revert that.. the idea was that if the response is not only json then we return fileresult for max flexibility. Bad idea probably.. will be reverted on monday

v13.7.3

Was this page helpful?
0 / 5 - 0 ratings