RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.73k stars 1.29k forks source link

UseSwaggerReDoc throws an exception using AspNet.Owin middleware #4801

Open rds500rs opened 7 months ago

rds500rs commented 7 months ago

UseSwaggerReDoc throws an exception using the NSwag.AspNet.Owin middleware in v14.0.3

The class 'NSwag.AspNet.Owin.Middlewares.SwaggerUiIndexMiddleware`1[[NSwag.Generation.WebApi.WebApiOpenApiDocumentGeneratorSettings, NSwag.Generation.WebApi, Version=14.0.3.0, Culture=neutral, PublicKeyToken=c2d88086e098d109]]' does not have a constructor taking 4 arguments.

   at Microsoft.Owin.Builder.AppBuilder.ToConstructorMiddlewareFactory(Object middlewareObject, Object[] args, Delegate& middlewareDelegate)
   at Microsoft.Owin.Builder.AppBuilder.ToMiddlewareFactory(Object middlewareObject, Object[] args)
   at Microsoft.Owin.Builder.AppBuilder.Use(Object middleware, Object[] args)
   at NSwag.AspNet.Owin.SwaggerExtensions.UseSwaggerReDoc(IAppBuilder app, IEnumerable`1 controllerTypes, Action`1 configure)

Looking back to the latest version of 13, the SwaggerUiIndexMiddleware constructor was changed from SwaggerUiSettingsBase to SwaggerUiSettings But ReDocSettings only inherits from SwaggerUiSettingsBase

mehroz377 commented 5 months ago

I am facing the same issue. Is there any update on this? My version is 14.0.7

PVLopes commented 2 months ago

same, using .NET Framework 4.7

mehroz377 commented 2 months ago

Is there any update on this?