Skip to content

Commit

Permalink
Avoid trimming / at the end of a route, #1101 (4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Dec 13, 2017
1 parent f426c6d commit 8d7ebe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NSwag.CodeGeneration/ClientGeneratorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private List<TOperationModel> GetOperations(SwaggerDocument document)
document.GenerateOperationIds();

return document.Paths
.SelectMany(pair => pair.Value.Select(p => new { Path = pair.Key.Trim('/'), HttpMethod = p.Key, Operation = p.Value }))
.SelectMany(pair => pair.Value.Select(p => new { Path = pair.Key.TrimStart('/'), HttpMethod = p.Key, Operation = p.Value }))
.Select(tuple =>
{
var operationModel = CreateOperationModel(tuple.Operation, BaseSettings);
Expand Down

0 comments on commit 8d7ebe5

Please sign in to comment.