File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/Microsoft.OpenApi.Readers/V2 Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1- // Copyright (c) Microsoft Corporation. All rights reserved.
1+ // Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT license.
33
44using System ;
@@ -139,8 +139,12 @@ internal static partial class OpenApiV2Deserializer
139139 {
140140 OpenApiConstants . Default ,
141141 new AnyFieldMapParameter < OpenApiHeader > (
142- p => p . Schema . Default ,
143- ( p , v ) => p . Schema . Default = v ,
142+ p => p . Schema ? . Default ,
143+ ( p , v ) =>
144+ {
145+ if ( p . Schema == null ) return ;
146+ p . Schema . Default = v ;
147+ } ,
144148 p => p . Schema )
145149 }
146150 } ;
@@ -151,8 +155,12 @@ internal static partial class OpenApiV2Deserializer
151155 {
152156 OpenApiConstants . Enum ,
153157 new AnyListFieldMapParameter < OpenApiHeader > (
154- p => p . Schema . Enum ,
155- ( p , v ) => p . Schema . Enum = v ,
158+ p => p . Schema ? . Enum ,
159+ ( p , v ) =>
160+ {
161+ if ( p . Schema == null ) return ;
162+ p . Schema . Enum = v ;
163+ } ,
156164 p => p . Schema )
157165 } ,
158166 } ;
You can’t perform that action at this time.
0 commit comments