Skip to content

Commit aa5292f

Browse files
committed
chore: clean up
2 parents a6e2546 + cd4d411 commit aa5292f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Microsoft.OpenApi/Models/OpenApiReference.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license.
33

44
using System;
5+
using System.Linq;
56
using System.Text.Json.Nodes;
67
using Microsoft.OpenApi.Extensions;
78
using Microsoft.OpenApi.Interfaces;

src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ public static IOpenApiSchema LoadSchema(ParseNode node, OpenApiDocument hostDocu
399399
schema.Extensions.Remove(OpenApiConstants.NullableExtension);
400400
}
401401

402-
if (identifier is not null && hostDocument.Workspace is not null)
402+
if (!string.IsNullOrEmpty(identifier) && hostDocument.Workspace is not null)
403403
{
404404
// register the schema in our registry using the identifier's URL
405-
hostDocument.Workspace.RegisterComponentForDocument(hostDocument, schema, identifier);
405+
hostDocument.Workspace.RegisterComponentForDocument(hostDocument, schema, identifier!);
406406
}
407407

408408
return schema;

0 commit comments

Comments
 (0)