A package to simplify using Swashbuckle Swagger behind YARP.
-
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. -
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.
Install the required .NET SDK.
Run:
$ dotnet build