I am developing a .netcore web application. I am using of swagger and I've made all the necessary adjustments. Unfortunately it does not work and I just see No operations defined in spec!
in the swagger output page.
The swagger file with /swagger/v1/swagger.json
has the following content:
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Something"
},
"paths": {},
"definitions": {}
}
I want to see my controllers and their actions in swagger output page.
you need to enable
XML Documentation file
underproject obtions => Build
tab.Then you need to read this file through swagger so that swagger can create documentation from it.
In ConfigureServices
after some research i was found that my problem was about using swagger along with OData in .NetCore2.1. i found a solution for this problem.
first i added two following Nuget packages:
then, i added following codes in Startup.cs
the, i added following code line in controllers:
please note that it was worked for me but it may be need more research for eventually side effects