diff --git a/src/Microsoft.OpenApi.Readers/ParseNodes/MapNode.cs b/src/Microsoft.OpenApi.Readers/ParseNodes/MapNode.cs index c924311d7..61f609817 100644 --- a/src/Microsoft.OpenApi.Readers/ParseNodes/MapNode.cs +++ b/src/Microsoft.OpenApi.Readers/ParseNodes/MapNode.cs @@ -125,7 +125,7 @@ public override Dictionary CreateMapWithReference( Id = entry.key }; } - } + } finally { Context.EndObject(); diff --git a/src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs b/src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs index beba2e815..7783fdca3 100644 --- a/src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs +++ b/src/Microsoft.OpenApi.Readers/V2/OpenApiDocumentDeserializer.cs @@ -36,13 +36,14 @@ internal static partial class OpenApiV2Deserializer }, { "consumes", - (o, n) => { + (o, n) => + { var consumes = n.CreateSimpleList(s => s.GetScalarValue()); if (consumes.Count > 0) { n.Context.SetTempStorage(TempStorageKeys.GlobalConsumes, consumes); } - } + } }, { "produces", (o, n) => { diff --git a/src/Microsoft.OpenApi.Readers/V3/OpenApiDocumentDeserializer.cs b/src/Microsoft.OpenApi.Readers/V3/OpenApiDocumentDeserializer.cs index 88cd93000..a4d16a429 100644 --- a/src/Microsoft.OpenApi.Readers/V3/OpenApiDocumentDeserializer.cs +++ b/src/Microsoft.OpenApi.Readers/V3/OpenApiDocumentDeserializer.cs @@ -26,13 +26,13 @@ internal static partial class OpenApiV3Deserializer {"components", (o, n) => o.Components = LoadComponents(n)}, {"tags", (o, n) => {o.Tags = n.CreateList(LoadTag); foreach (var tag in o.Tags) - { + { tag.Reference = new() { Id = tag.Name, Type = ReferenceType.Tag }; - } + } } }, {"externalDocs", (o, n) => o.ExternalDocs = LoadExternalDocs(n)}, {"security", (o, n) => o.SecurityRequirements = n.CreateList(LoadSecurityRequirement)}