diff --git a/Swashbuckle.Core/Application/SwaggerUiConfig.cs b/Swashbuckle.Core/Application/SwaggerUiConfig.cs index f5e75aab8..fa091f2d2 100644 --- a/Swashbuckle.Core/Application/SwaggerUiConfig.cs +++ b/Swashbuckle.Core/Application/SwaggerUiConfig.cs @@ -103,6 +103,15 @@ public void CustomAsset(string path, Assembly resourceAssembly, string resourceN if (path == "index") isTemplate = true; _pathToAssetMap[path] = new EmbeddedAssetDescriptor(resourceAssembly, resourceName, isTemplate); } + + public void CustomTemplateParameter(string templateParameterName, string parameterValue) + { + var nameWithPercentParenthesesWrapper = + templateParameterName.StartsWith("%(") + ? templateParameterName + : $"%({templateParameterName})"; + _templateParams[nameWithPercentParenthesesWrapper] = parameterValue; + } public void EnableDiscoveryUrlSelector() { @@ -170,4 +179,4 @@ public enum DocExpansion List, Full } -} \ No newline at end of file +}