We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent339f61f commitd3c758bCopy full SHA for d3c758b
src/Microsoft.OpenApi/Reader/ParseNodes/MapNode.cs
@@ -33,6 +33,7 @@ public MapNode(ParsingContext context, JsonNode node) : base(
33
}
34
35
_node=mapNode;
36
+_nodes=new(()=>_node.Select(p=>GetPropertyNodeFromJsonNode(p.Key,p.Value)).ToList(),true);
37
38
39
publicPropertyNode?this[stringkey]
@@ -130,11 +131,10 @@ public override Dictionary<string, HashSet<T>> CreateArrayMap<T>(Func<ValueNode,
130
131
returnnodes.ToDictionary(kvp=>kvp.key, kvp=>kvp.values);
132
133
-privateList<PropertyNode>?_nodes;
134
+privatereadonlyLazy<List<PropertyNode>>_nodes;
135
publicIEnumerator<PropertyNode>GetEnumerator()
136
{
-_nodes??=_node.Select(p=>GetPropertyNodeFromJsonNode(p.Key,p.Value)).ToList();
137
-return_nodes.GetEnumerator();
+return_nodes.Value.GetEnumerator();
138
139
140
IEnumeratorIEnumerable.GetEnumerator()