From 8aaab772b5f4e14ea096799e19da064b5332311b Mon Sep 17 00:00:00 2001 From: Zircon99 Date: Fri, 6 Jun 2025 15:39:32 +0200 Subject: [PATCH] Update ObjectTypeVisitor.cs Swagger is not being generated when 2 properties are named the same in the JSON with different property parents --- .../Visitors/ObjectTypeVisitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/ObjectTypeVisitor.cs b/src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/ObjectTypeVisitor.cs index 9a1ff8a1..c9ebd20f 100644 --- a/src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/ObjectTypeVisitor.cs +++ b/src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/ObjectTypeVisitor.cs @@ -225,7 +225,7 @@ private void ProcessProperties(IOpenApiSchemaAcceptor instance, string schemaNam // Adds schemas to the root. var schemasToBeAdded = subAcceptor.Schemas - .Where(p => !instance.Schemas.Keys.Contains(p.Key)) + .Where(p => !(instance.Schemas.Keys.Contains(p.Key) && instance.Schemas[p.Key].Type == p.Value.Type)) .Where(p => p.Value.IsOpenApiSchemaObject()) .GroupBy(p => p.Value.Title) .Select(p => p.First())