Visitar URL original
fix: circular ref guard by gavinbarron · Pull Request #3033 · microsoft/OpenAPI.NET · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CodeQL fixes
  • Loading branch information
gavinbarron committed Aug 19, 2026
commit d09dff2fe34dea5d6782edda48d154647210f8ef
4 changes: 2 additions & 2 deletions src/Microsoft.OpenApi.YamlReader/YamlJsonParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json.Nodes;
Expand Down Expand Up @@ -180,7 +180,7 @@ private void AddNode(MaterializedNode materialized)
frame.NodeCount = checked(frame.NodeCount + materialized.NodeCount);
frame.MaxChildHeight = Math.Max(frame.MaxChildHeight, materialized.Height);
break;
case JsonObject map when frame.PendingKey is null:
case JsonObject when frame.PendingKey is null:
frame.PendingKey = materialized.MappingKey
?? throw new OpenApiReaderException("YAML mapping keys must be scalar values.");
break;
Expand Down
7 changes: 2 additions & 5 deletions src/Microsoft.OpenApi/Validations/Rules/OpenApiSchemaRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,9 @@ private static IEnumerable<IOpenApiSchema> GetSchemaCombinators(IOpenApiSchema s

private static void EnqueueSchemas(Queue<IOpenApiSchema> schemasToVisit, IEnumerable<IOpenApiSchema> childSchemas)
{
foreach (var childSchema in childSchemas)
foreach (var childSchema in childSchemas.Where(childSchema => childSchema is not null))
{
if (childSchema is not null)
{
schemasToVisit.Enqueue(childSchema);
}
schemasToVisit.Enqueue(childSchema);
}
}

Expand Down