Skip to content

Commit

Permalink
Merge pull request 'feature/openapi' (#128) from feature/openapi into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
pavelbannov committed Dec 27, 2024
2 parents 228f81a + ad95d69 commit 08371c3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion common/ASC.Common/Utils/SwaggerCustomDocumentFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 08371c3

Please sign in to comment.