Is there a way to hide the Links column in the Swagger Responses section of the endpoints? We do not use links in the APIs and it just wastes space, so would like to get them gone from all endpoints.
Using ASP.NET Core with 8. I looked around but could not find any articles other than the ones explaining what OpenAPI links are for.
Is there a way to hide the Links column in the Swagger Responses section of the endpoints? We do not use links in the APIs and it just wastes space, so would like to get them gone from all endpoints.
Using ASP.NET Core with 8. I looked around but could not find any articles other than the ones explaining what OpenAPI links are for.
Share Improve this question edited Feb 4 at 15:49 Jeremy Fiel 3,3072 gold badges11 silver badges26 bronze badges asked Feb 4 at 1:31 Alek DavisAlek Davis 10.8k3 gold badges45 silver badges56 bronze badges1 Answer
Reset to default 1According to your description, I suggest you could create a custom CSS and inject it to your swagger UI to hide the link tab.
More details, you could refer to below codes:
1.Create a wwwroot folder , a swagger-ui folder and CSS file with below codes:
.swagger-ui .response-col_links {
min-width: 6em;
display: none;
}
2.Modify the Program.cs as below:
var app = builder.Build();
app.UseStaticFiles();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.InjectStylesheet("/swagger-ui/custom.css");
});
}
....
Result: