Skip to content

Commit

Permalink
Add space between duplicated actions in error message (#3177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saibamen authored Nov 26, 2024
1 parent 5dd46c4 commit 6dcf7a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private async Task<Dictionary<OperationType, OpenApiOperation>> GenerateOperatio
"Actions require a unique method/path combination for Swagger/OpenAPI 2.0 and 3.0. Use ConflictingActionsResolver as a workaround or provide your own implementation of PathGroupSelector.",
httpMethod,
group.First().RelativePath,
string.Join(",", group.Select(apiDesc => apiDesc.ActionDescriptor.DisplayName))));
string.Join(", ", group.Select(apiDesc => apiDesc.ActionDescriptor.DisplayName))));
}

var apiDescription = (count > 1) ? _options.ConflictingActionsResolver(group) : group.Single();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ public void GetSwagger_ThrowsSwaggerGeneratorException_IfActionsHaveConflictingH
var exception = Assert.Throws<SwaggerGeneratorException>(() => subject.GetSwagger("v1"));
Assert.Equal(
"Conflicting method/path combination \"POST resource\" for actions - " +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithNoParameters (Swashbuckle.AspNetCore.SwaggerGen.Test)," +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithNoParameters (Swashbuckle.AspNetCore.SwaggerGen.Test), " +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithNoParameters (Swashbuckle.AspNetCore.SwaggerGen.Test). " +
"Actions require a unique method/path combination for Swagger/OpenAPI 2.0 and 3.0. Use ConflictingActionsResolver as a workaround or provide your own implementation of PathGroupSelector.",
exception.Message);
Expand Down Expand Up @@ -1167,7 +1167,7 @@ public void GetSwagger_ThrowsSwaggerGeneratorException_IfActionsHaveConflictingH
var exception = Assert.Throws<SwaggerGeneratorException>(() => subject.GetSwagger("v1"));
Assert.Equal(
"Conflicting method/path combination \"GET resource\" for actions - " +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithNoParameters (Swashbuckle.AspNetCore.SwaggerGen.Test)," +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithNoParameters (Swashbuckle.AspNetCore.SwaggerGen.Test), " +
"Swashbuckle.AspNetCore.SwaggerGen.Test.FakeController.ActionWithIntFromQueryParameter (Swashbuckle.AspNetCore.SwaggerGen.Test). " +
"Actions require a unique method/path combination for Swagger/OpenAPI 2.0 and 3.0. Use ConflictingActionsResolver as a workaround or provide your own implementation of PathGroupSelector.",
exception.Message);
Expand Down

0 comments on commit 6dcf7a5

Please sign in to comment.