Skip to content

Commit

Permalink
fix by id
Browse files Browse the repository at this point in the history
  • Loading branch information
shemogumbe committed Apr 5, 2023
1 parent fa984b8 commit af0d4a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private static string GetFluentApiPath(IEnumerable<OpenApiUrlTreeNode> nodes)

return openApiUrlTreeNodes.Select(static x => {
if(x.Segment.IsCollectionIndex())
return $"ById{x.Segment.Replace("{", "('").Replace("}", "')")}";
return $"by_id{x.Segment.Replace("{", "('").Replace("}", "')")}";
if (x.Segment.IsFunction())
return x.Segment.RemoveFunctionBraces().Split('.')
.Select(static s => s.ToFirstCharacterLowerCase())
Expand All @@ -347,7 +347,7 @@ private static string GetFluentApiPath(IEnumerable<OpenApiUrlTreeNode> nodes)
})
.Aggregate(static (x, y) =>
{
var dot = y.StartsWith("ById") ? string.Empty : ".";
var dot = y.StartsWith("by_id") ? string.Empty : "_";
return $"{x.Trim('$')}{dot}{y.Trim('$')}";
}).Replace("()ById(", "by_id(")
.Replace("()().", "().");
Expand Down

0 comments on commit af0d4a9

Please sign in to comment.