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
'No operations defined in spec!' problem after update of 'Microsoft.AspNetCore.Mvc.ApiExplorer' nuget #1166
Comments
Is it worth trying a newer version of Swashbuckle.AspNetCore? https://www.nuget.org/packages/Swashbuckle.AspNetCore |
@mikebeaton hi, i will try to create a mockup repo in public github with reproduced scenario |
i created demo repository with 100% reproducible problem. Master branch: https://github.com/erinev/net-core-api-for-digging-swashbuckle-issue/tree/master
**note: "Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.1.3" & "Swashbuckle.AspNetCore" Version="4.0.1" everything works after running solution and opening http://localhost:5000/swagger -> swagger UI displays ad relations controller and requests can be executed i updated just "Microsoft.AspNetCore.Mvc.ApiExplorer" to 2.2.0 in branch: everything compiles but when i open http://localhost:5000/swagger i see empty list of operations:
cc: @mikebeaton |
I do get the symptoms you describe, and I am not quite sure what is going on but I don't think the problem is with If I run your example with I saw this by cloning Since the value of |
@mikebeaton thanks for deep investigation. i liked the way you checked the issue. Maybe you still have compiling code with |
Hi @erinev, I'm glad it helped. You should reproduce my steps yourself, at this point.
Okay, what I would do next:
By this point, you will either have a very minimal example of something which works fine with Obviously, report back if after stripping things back like this, you still find that you think that the problem lies in HTH ;) |
Thanks for detailed instructions and hints what to do next, i will try it and i will update you with results |
Update on the issue: In master branch: https://github.com/erinev/net-core-api-for-digging-swashbuckle-issue/tree/master everything works with i created a branch: https://github.com/erinev/net-core-api-for-digging-swashbuckle-issue/pull/2/files where i update and ofcourse swagger is not rendered. so problem is really not in the swashbuckle, but our project setup (or some missing nuget packages) |
i also created branch with removed swashbuckle: https://github.com/erinev/net-core-api-for-digging-swashbuckle-issue/tree/remove_swashbuckle And after update of ApiExplorer to 2.2.0: erinev/net-core-api-for-digging-swashbuckle-issue#3 routings stops working and all requests returns 404 so problem really lies somewhere else |
Hi. That's great. If you're happy that this issue doesn't lie with this repo, then you should probably close off this issue, if that's okay? Just in the spirit of continuing to help, what I would try next is...
Keep me posted if you like but also, as I say, if the issue isn't here then probably close off this issue? Thanks! |
ok i will close this issue, thanks for another notes. |
@mikebeaton your suggestion (comparing with default API template by MS) worked! :) i found and issue: in order to make ApiExplorer v2.2.0 version work one line needs to be changed in .csproj of HOST project: from just i don't know why, i will go to google it what are the differences and is it safe to change to |
For others attempting the fix quoted, you may have to recreate your publish profile(s) to be of the Web project type, since the shape and parameters in them are different. After that, it worked perfectly :) |
Hi,
we have .net core 2.1 mvc webapi project which uses Swagger.
we use following packages:
swashbuckle is configured in following way:
everything woks in such setup.
we are trying to migrate our .net core project from 2.1 to 2.2 .net core.
In order to do that (without warnings) we need upgrade
Microsoft.AspNetCore.Mvc.ApiExplorer
nuget from 2.1.2 to 2.2.0.After this nuget update swagger.json (
/swagger/v1/swagger.json
) doesn't contain any"paths": {}
and"definitions": {}
and this results in swagger UI showing no controllers/actions (it renders:No operations defined in spec!
after upgrade package these package versions is updated:
what im missing which packages needs to be updated also so
swagger.json
would be generated properly when usingMicrosoft.AspNetCore.Mvc.ApiExplorer 2.2.0
package ?or i'm missing something else ?
The text was updated successfully, but these errors were encountered: