Expose a middleware to output Open API description for a certain OData service

Open
#62 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, openapi
Domain
api, backend

Research direction

Start with the proposed ODataOpenApiMiddleware, its Invoke method, the UseODataOpenApi extension, and the Configure example in this issue. Clarify how the middleware should select a certain OData service and what response and routing behavior define completion; no implementation files or tests are identified.

Written by the indexing model from the issue text.

Description

status:needs-discussion type:enhancement

Maybe we can have an extension middleware to expose the OpenAPI description for a certain OData service.

For example:

public class ODataOpenApiMiddleware
{
    private readonly RequestDelegate next;

    public ODataOpenApiMiddleware(RequestDelegate next)
    {
        this.next = next;
    }

    public async Task Invoke(HttpContext context)
    {
        // implementation here
    }
}

Extension method:

public static IApplicationBuilder UseODataOpenApi(this IApplicationBuilder app)
{
    return app.UseMiddleware<ODataOpenApiMiddleware>();
}

Configure the Middleware:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

       app.UseODataOpenApi();

       app.UseRouting();

       app.UseEndpoints(...);
}
Dominant language
C#
Stars
240
Forks
70
Avg merge
7h 59m
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

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.

More from microsoft/OpenAPI.NET.OData

All issues in microsoft/OpenAPI.NET.OData

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.