File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Microsoft.OpenApi/Reader/V31 Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -185,9 +185,17 @@ internal static partial class OpenApiV31Deserializer
185185 ( o , n , _ ) =>
186186 {
187187 var nullable = bool . Parse ( n . GetScalarValue ( ) ) ;
188- if ( nullable ) // if nullable, convert type into an array of type and null
188+ if ( nullable ) // if nullable, convert type into an array of type(s) and null
189189 {
190- o . Type = new string [ ] { o . Type . ToString ( ) , OpenApiConstants . Null } ;
190+ if ( o . Type is string [ ] typeArray )
191+ {
192+ var typeList = new List < string > ( typeArray ) { OpenApiConstants . Null } ;
193+ o . Type = typeList . ToArray ( ) ;
194+ }
195+ else if ( o . Type is string typeString )
196+ {
197+ o . Type = new string [ ] { typeString , OpenApiConstants . Null } ;
198+ }
191199 }
192200 }
193201 } ,
You can’t perform that action at this time.
0 commit comments