Build netcoreapi framework (1. Use of swagger plug-in)



1. Create a new project with vs2017


2. Start to introduce the swagger plug-in

Right click Project = > manage nuget packages = > Search Swashbuckle.AspNetCore Click Install

3. Open Startup.cs Class, edit the configureservices class

Edit configure

4. Set the swagger UI page as the startup page launchSettings.json Change the value of launchurl to swagger/ index.html )

At this time, press and hold Ctrl + F5 to run

5. Display notes

Platform services needs to reference the nuget package Microsoft.Extensions.PlatformAbstractions

6. Notes of display controller

Run to see the results


[20190809] when I was looking for information, I found a person who had the same idea as me. He wanted to build a framework, and his blog was very mature. There are two schemes added to the annotation of the swagger display controller. You can have a look But I will continue to write.


Recommended Today

Blog based on beego, go blog

Go Blog A beego based development, can quickly create personal blog, CMS system Include functions see Official website of go Demo Update log time function January 23, 2020 New top post function February 2, 2020 New custom navigation function February 4, 2020 New site announcement function February 6, 2020 New link module February […]