Created
June 21, 2024 07:16
-
-
Save jondjones/e12e2d15f9862f8422d7fa6a9552456e to your computer and use it in GitHub Desktop.
Umbraco Management API Explained By An Idiot - 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwaggerRouteProductionPipelineFilter() : SwaggerRouteTemplatePipelineFilter("umbraco") | |
{ | |
protected override bool SwaggerIsEnabled(IApplicationBuilder applicationBuilder) => true; | |
} | |
public static class MyConfigureSwaggerRouteUmbracoBuilderExtensions | |
{ | |
public static IUmbracoBuilder ConfigureProductionSwaggerRoute(this IUmbracoBuilder builder) | |
{ | |
builder.Services.Configure<UmbracoPipelineOptions>(options => | |
{ | |
options.PipelineFilters.RemoveAll(filter => filter is SwaggerRouteTemplatePipelineFilter); | |
options.AddFilter(new SwaggerRouteProductionPipelineFilter()); | |
}); | |
return builder; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment