Skip to content

A package to simplify using Swashbuckle Swagger behind YARP.

License

Notifications You must be signed in to change notification settings

ctyar/Swashbuckle.Yarp

Repository files navigation

Swashbuckle Yarp

Build Status Ctyar.Swashbuckle.Yarp

A package to simplify using Swashbuckle Swagger behind YARP.

Usage

  1. Add a route for each of your APIs like this:

    "route1": {
     "ClusterId": "cluster1",
     "Match": {
       "Path": "/api1/{**catch-all}"
     },
     "Transforms": [
       {
         "PathRemovePrefix": "/api1"
       }
     ]
    }

    With this configuration, calling /api1 of your YARP will redirect to your RESTful API.

  2. Add AddYarp() with the same prefix in your RESTful API:

    app.UseSwagger(o =>
    {
        o.AddYarp("/api1");
    });

You can check the samples directory for a complete working example.

Build

Install the required .NET SDK.

Run:

$ dotnet build

About

A package to simplify using Swashbuckle Swagger behind YARP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published