OData / OData/AspNetCoreOData

OData 8, .net core 5, aspnet-api-versioning, & swagger

Open
#214 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

followup
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

I'm trying to upgrade our project to .net core 5, which apparently requires upgrading to OData 8.

But, OData 8 appears to be incompatible with Microsoft.AspNetCore.OData.Versioning.ApiExplorer, so I was required to remove the dependency on that and change the startup call from

 services.AddODataApiExplorer()

to instead use the one in Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer

 services.AddVersionedApiExplorer();

Not surprisingly, swagger isn't showing any of the OData API definitions. I cloned your samples directory and found that swagger doesn't seem to be working there, either.

image

What is the recommended way to get OData 8 API definitions hooked up to swagger?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the samples directory and the startup calls AddODataApiExplorer() and AddVersionedApiExplorer(). Reproduce the Swagger output with OData 8 and the ASP.NET Core 5 setup; done means the OData API definitions appear in Swagger without the incompatible versioning dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.