Skip to content

Commit 2128408

Browse files
committed
Guard ReferenceType consumption for ExternalResource
1 parent 8ea0964 commit 2128408

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Microsoft.OpenApi/Models/OpenApiReference.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,11 @@ private string GetExternalReferenceV3()
200200
{
201201
return ExternalResource + "#" + Id;
202202
}
203-
204-
return ExternalResource + "#/components/" + Type.Value.GetDisplayName() + "/"+ Id;
203+
204+
if (Type.HasValue)
205+
{
206+
return ExternalResource + "#/components/" + Type.Value.GetDisplayName() + "/"+ Id;
207+
}
205208
}
206209

207210
return ExternalResource;

0 commit comments

Comments
 (0)