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
sc
  • Loading branch information
StefH committed Nov 15, 2025
commit 643bf5af8d1d6b677356cff9fcf74dc7580ac09d
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ private static void MergeSchema(Dictionary<string, JsonValueInfo> schema, JObjec
{
if (prop.Value is JObject nested)
{
if (!schema.ContainsKey(prop.Name))
if (!schema.TryGetValue(prop.Name, out var jsonValueInfo))
{
schema[prop.Name] = new JsonValueInfo(JTokenType.Object, new Dictionary<string, JsonValueInfo>());
jsonValueInfo = new JsonValueInfo(JTokenType.Object, new Dictionary<string, JsonValueInfo>());
schema[prop.Name] = jsonValueInfo;
}

MergeSchema((Dictionary<string, JsonValueInfo>)schema[prop.Name].Value!, nested);
MergeSchema((Dictionary<string, JsonValueInfo>)jsonValueInfo.Value!, nested);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ private static void MergeSchema(Dictionary<string, JsonValueInfo> schema, JsonOb
{
if (prop.Value is JsonObject nested)
{
if (!schema.ContainsKey(prop.Key))
if (!schema.TryGetValue(prop.Key, out var jsonValueInfo))
{
schema[prop.Key] = new JsonValueInfo(JsonValueKind.Object, new Dictionary<string, JsonValueInfo>());
jsonValueInfo = new JsonValueInfo(JsonValueKind.Object, new Dictionary<string, JsonValueInfo>());
schema[prop.Key] = jsonValueInfo;
}

MergeSchema((Dictionary<string, JsonValueInfo>)schema[prop.Key].Value!, nested);
MergeSchema((Dictionary<string, JsonValueInfo>)jsonValueInfo.Value!, nested);
}
else
{
Expand Down
Loading