diff --git a/src/NSwag.CodeGeneration/ClientGeneratorBase.cs b/src/NSwag.CodeGeneration/ClientGeneratorBase.cs index 2e0f45d1fc..e93f38c60a 100644 --- a/src/NSwag.CodeGeneration/ClientGeneratorBase.cs +++ b/src/NSwag.CodeGeneration/ClientGeneratorBase.cs @@ -110,7 +110,7 @@ private List 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);