Skip to content

Commit a60b992

Browse files
committed
Use null coalesce ?? operator
1 parent 74d8866 commit a60b992

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@ public void RegisterComponents(OpenApiDocument document)
6969
// Register Schema
7070
foreach (var item in document.Components.Schemas)
7171
{
72-
if (item.Value.Id != null)
73-
{
74-
location = item.Value.Id;
75-
}
76-
else
77-
{
78-
location = baseUri + ReferenceType.Schema.GetDisplayName() + "/" + item.Key;
79-
}
72+
location = item.Value.Id ?? baseUri + ReferenceType.Schema.GetDisplayName() + "/" + item.Key;
8073

8174
RegisterComponent(location, item.Value);
8275
}

0 commit comments

Comments
 (0)