Skip to content

Commit 43351ca

Browse files
committed
If the reference is a url identifier, serialize it as is
1 parent e0a3bb2 commit 43351ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Microsoft.OpenApi/Models/OpenApiReference.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ public string ReferenceV3
9595
{
9696
return Id;
9797
}
98+
if (Id.StartsWith("https"))
99+
{
100+
return Id;
101+
}
98102

99103
return "#/components/" + Type.GetDisplayName() + "/" + Id;
100104
}
@@ -236,6 +240,11 @@ private string GetExternalReferenceV3()
236240
return ExternalResource + "#" + Id;
237241
}
238242

243+
if (Id.StartsWith("https"))
244+
{
245+
return Id;
246+
}
247+
239248
return ExternalResource + "#/components/" + Type.GetDisplayName() + "/" + Id;
240249
}
241250

0 commit comments

Comments
 (0)