Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用了services.AddDynamicWebApi()这个默认配置后启动报错 #58

Open
inc-zz opened this issue Oct 28, 2022 · 1 comment
Open

Comments

@inc-zz
Copy link

inc-zz commented Oct 28, 2022

按照源码默认运行时,在Service中继承了IDynamicWebApi的服务类并没有生成swagger文档

改用services.AddDynamicWebApi()时,启动报错:
Microsoft.AspNetCore.Hosting.Diagnostics[6]
Application startup exception
System.NullReferenceException: Object reference not set to an instance of an object.
at Panda.DynamicWebApiSample.Dynamic.ServiceActionRouteFactory.CreateActionRouteModel(String areaName, String controllerName, ActionModel action) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\samples\Panda.DynamicWebApiSample\Dynamic\ServiceActionRouteFactory.cs:line 17
at Panda.DynamicWebApi.DynamicWebApiConvention.CreateActionRouteModel(String areaName, String controllerName, ActionModel action) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 345
at Panda.DynamicWebApi.DynamicWebApiConvention.NormalizeSelectorRoutes(String areaName, String controllerName, ActionModel action) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 321
at Panda.DynamicWebApi.DynamicWebApiConvention.ConfigureSelector(String areaName, String controllerName, ActionModel action) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 233
at Panda.DynamicWebApi.DynamicWebApiConvention.ConfigureSelector(ControllerModel controller, DynamicWebApiAttribute controllerAttr) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 212
at Panda.DynamicWebApi.DynamicWebApiConvention.ConfigureDynamicWebApi(ControllerModel controller, DynamicWebApiAttribute controllerAttr) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 83
at Panda.DynamicWebApi.DynamicWebApiConvention.Apply(ApplicationModel application) in C:\Users\Administrator\Downloads\Panda.DynamicWebApi-master\Panda.DynamicWebApi-master\src\Panda.DynamicWebApi\DynamicWebApiConvention.cs:line 45

@stulzq
Copy link
Collaborator

stulzq commented Nov 24, 2022

升级一下 swagger Swashbuckle.AspNetCore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants