.net core 3.0 swagger

1. Install package swagger

2.startup里configservers

 

 

 Configure

 

 

 3. The error may occur

Tip error xxxxnot found

Since webapi I created a restful style more so when the same type of interface is actually appear to be wrong [which] can not find the interface

Solution:

a. designated route on an interface, such as [Route ( "xxx")] or [httpget ( "xxx / xxx / {id}")]

b. Because I really do not like me so restful interface specified route on startup

app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=WeatherForecast}/{action=Get}/{id?}");
            });

 

Guess you like

Origin www.cnblogs.com/weiruanojbk/p/12355433.html