Skip to content

Cleanup implementation of UseJsonApi #733

Closed
@bart-degreed

Description

@bart-degreed

We recently added several flags to deal with middleware pipeline ordering issues in NetCore3. A better approach would be to move the inverse relationship building logic into the configuration phase.

And then only call:

app.UseMiddleware<JsonApiMiddleware>(); // old name: CurrentRequestMiddleware

from within this method. This allows callers to order/omit steps as they like, without sending us flags. Requires updates to documentation too.

Before:

public void Configure(IApplicationBuilder app)
{
    app.UseJsonApi();
}

After:

public void Configure(IApplicationBuilder app)
{
    app.UseRouting();
    app.UseAuthentication(); // optional
    app.UseAuthorization(); // optional
    app.UseJsonApi();
    app.UseEndpoints(endpoints => endpoints.MapControllers());
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions