Skip to content

Commit ee2495f

Browse files
committed
if node value is string, get the scalar value, else cast it into an array and assign it to the type property
1 parent 13d5061 commit ee2495f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,17 @@ internal static partial class OpenApiV31Deserializer
119119
},
120120
{
121121
"type",
122-
(o, n, _) => o.TypeArray = n.CreateSimpleList((n2, p) => n2.GetScalarValue()).ToArray()
123-
122+
(o, n, _) =>
123+
{
124+
if (n is ValueNode)
125+
{
126+
o.Type = n.GetScalarValue();
127+
}
128+
else
129+
{
130+
o.Type = n.CreateSimpleList((n2, p) => n2.GetScalarValue()).ToArray();
131+
}
132+
}
124133
},
125134
{
126135
"allOf",

0 commit comments

Comments
 (0)