diff --git a/common/ASC.Common/Utils/SwaggerCustomDocumentFilter.cs b/common/ASC.Common/Utils/SwaggerCustomDocumentFilter.cs index c798508a5e..c7f1d890b4 100644 --- a/common/ASC.Common/Utils/SwaggerCustomDocumentFilter.cs +++ b/common/ASC.Common/Utils/SwaggerCustomDocumentFilter.cs @@ -44,7 +44,17 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) var paths = new OpenApiPaths(); foreach (var (key, value) in swaggerDoc.Paths) { - var lowerCaseKey = key.ToLowerInvariant(); + var segments = key.Split('/'); + + for (var i = 0; i < segments.Length; i++) + { + if (!segments[i].StartsWith("{") && !segments[i].EndsWith("}")) + { + segments[i] = segments[i].ToLowerInvariant(); + } + } + + var lowerCaseKey = string.Join("/", segments); paths.Add(lowerCaseKey, value); }