I am configuring my swagger ui like so:
builder.Services.AddSwaggerGen(c => {
c.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo()
{
Title = "Skillbased Middleware API Info",
Version = "v1"
});
});
var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Company API Testing v1");
});
but i cannot make a signel crud request to the server, because it always requires a certain header (zumo api version) to go through.
Where can I add this to my swagger config? This is form an asp.net core web application
I got as far as to put this:
public class SwaggerHeader : IOperationFilter
{
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
if (operation.Parameters == null)
operation.Parameters = new List<OpenApiParameter>();
operation.Parameters.Add(new OpenApiParameter
{
Name = "ZUMO-API-VERSION=",
Description = "3.0.0",
Required = true // set to false if this is optional
});
}
}
But if I try to execute any command, it just loads and loads and never gets to a result...