So basically using NSwagStudio or Unchase openAPI to generate a c# client api work. But when using it, the return data are null. I see some thread telling to deactivate the wrapresult in PreInitialize() of Core WebCoreModule.cs
Like this:
Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnError = false;
Configuration.Modules.AbpAspNetCore().DefaultWrapResultAttribute.WrapOnSuccess = false;
So doing this, make the client api working but, all the website is not working anymore.
Trying to change any data making display the general error box.
Using ASP.NET CORE MVC & jQuery v12.2.0
3 Answer(s)
-
0
Hi @martp00
For our MAUI application, we are using custom proxy services, you can check this example https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application.Client/MultiTenancy/ProxyTenantAppService.cs
If you want to use C# proxies generated by NSwagStudio, you may create a base class for your services, process the return result and only return unwrapped result.
-
0
Thank you for your answer, the url doesn't look to work,
I try to decorate my function with this
[ProducesResponseType(200, Type = typeof(ResponseWrapper<AuthenticateResultModel>))]
Also, I make the custom ResponseWrapper class, it seems to work and now I have also the swagger definition who reflect the wrap result.
-
0
Hi @martp00
I'm glad that you have solved this. You can access the AspNet Zero's private GitHub repository by adding your GitHub username on https://aspnetzero.com/LicenseManagement page. Or, you can send an email to [email protected] about this.