Hi, in the 9th version, which we downloaded recently, there seems to be an inconsistency between angular and aspnetcore projects in terms of Swagger. In angular project there are many "generic" types like EntityDtoOfGuid, PagedResultDtoOfNameValueDto etc. which correspond to EntityDto<Guid> and PagedResultDto<NameValueDto> in c#. However, Swashbuckle implementation of swagger, which is used in Startup.cs, does not support generics, and these types are not generated when updating service-proxies.ts. After some investigation, we found out that Nswag does this, and we assume that Startup.cs in Web.Host, and Swagger*Filters in Web.Core are wrong. Could you check this?
8 Answer(s)
-
0
Hi @kateryna.zorina
Does this cause any error when you update service-proxies ?
-
0
Hi! When updaing service proxies "generic" types like EntityDtoOfGuid, PagedResultDtoOfNameValueDto are not generated at all, and we get angular build errors, because these types are referenced in many places, e.g. common-lookup-modal.component.ts
-
0
Hi! After some investigation, we confirm that there is inconsistency between frontend and backend in terms of swagger and service-proxies in the 9.00v of the framework. Backend must use NSwag, because it generates generic types e.g.: EntityDtoOfGuid, PagedResultDtoOfNameValueDto, which are referenced in frontend. This means that in Web.Host Startup.cs, in ConfigureServices, should be a call to services.AddSwaggerDocument, and in Configure calls to app.UseOpenApi(); and app.UseSwaggerUi3. Also, corresponding nuget packages must be installed.
-
0
Hi,
Could you compare your Startup.cs with the one from AspNet Zero's master branch https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/Startup/Startup.cs ?
-
0
Hi,
We compared our current version with Startup.cs from master branch and see the same problem there. Please, double check that current configuration of Swagger in Startap.cs from master does generate models in the same way as in service-proxies.ts from angular master. Check PagedResultDtoOfNameValueDto, EntityDtoOfInt64, etc.
-
0
Hi **@kateryna.zorina **
I just tried this from DEV branch and couldn't reproduce your problem. If you have a project which reproduces this, could you share it via email with [email protected] ?
-
0
Hi! As it was suggested in one of previous comments, we compared our version with version from master branch. We will compare with develop and get back to you.
-
0
Hi @kateryna.zorina
Thanks. If it doesn't work for you, please share your project with [email protected] and we will check it for you.
Thanks,