From c2d3f997e649a12b7dd185f48680dc1468dc7d73 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Fri, 27 Sep 2024 11:36:14 +0300 Subject: [PATCH] Ensure unique parameters are added --- src/Microsoft.OpenApi/Services/OpenApiFilterService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs index fcc2af0b2..bd351ce0e 100644 --- a/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs +++ b/src/Microsoft.OpenApi/Services/OpenApiFilterService.cs @@ -112,7 +112,10 @@ public static OpenApiDocument CreateFilteredDocument(OpenApiDocument source, Fun { foreach (var parameter in result.Parameters) { - pathItem.Parameters.Add(parameter); + if (!pathItem.Parameters.Contains(parameter)) + { + pathItem.Parameters.Add(parameter); + } } } }