I am working on an ASP.NET Core 5 API project and I am using Microsoft.AspNetCore.OData v8.0.0-preview2.
If I use the out-of-box ASP Net Web application template, before I add OData, Swagger works just fine.
However, as soon as I add the following code;
services.AddOData(
option => option.AddModel("v1", GetV1EdmModel())
.Select()
.Expand()
.Filter()
.OrderBy()
.Count());
... to my Startup.cs --> ConfigureServices method and then try to navigate to the ../swagger endpoint the swagger page loads but displays the following error;
Failed to load API definition
Fetch error
unidentified /swapper/v1/swagger.json
Is swagger not yet supported in the Microsoft.AspNetCore.OData v8.0.0-preview2 release? Or am I missing something.
I have read through Sam Xu's blog posts; ASP.NET Core OData 8.0 Preview for .NET 5 and Routing in ASP.NET Core OData 8.0 Preview
But there was no mention of this issue.
Does anyone have a solution or a work around?