Skip to content

Commit 12d3f70

Browse files
committed
Write tests to validate failing behavior for Azure#313 & Azure#380
1 parent cc95f4a commit 12d3f70

File tree

3 files changed

+784
-3
lines changed

3 files changed

+784
-3
lines changed

src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Extensions/TypeExtensions.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,19 @@ public static Type GetUnderlyingType(this Type type)
458458
}
459459

460460
if (type.IsOpenApiArray())
461-
{
462-
underlyingType = type.GetElementType() ?? type.GetGenericArguments()[0];
461+
{
462+
underlyingType = type.GetElementType();
463+
if (underlyingType == null)
464+
{
465+
if (type.IsNested)
466+
{ // Does not work for implemented interfaces
467+
underlyingType = type.BaseType;
468+
}
469+
else
470+
{
471+
underlyingType = type.GetGenericArguments()[0];
472+
}
473+
}
463474
}
464475

465476
if (type.IsOpenApiDictionary())

src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Visitors/ListObjectTypeVisitor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public override void Visit(IAcceptor acceptor, KeyValuePair<string, Type> type,
6464
};
6565
this.visitedTypes.Add(underlyingType, subAcceptor);
6666
subAcceptor.Accept(this.VisitorCollection, namingStrategy);
67-
6867
}
6968
else
7069
{

0 commit comments

Comments
 (0)