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.
2
2
// Licensed under the MIT license.
3
3
4
4
using System ;
@@ -139,8 +139,12 @@ internal static partial class OpenApiV2Deserializer
139
139
{
140
140
OpenApiConstants . Default ,
141
141
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
+ } ,
144
148
p => p . Schema )
145
149
}
146
150
} ;
@@ -151,8 +155,12 @@ internal static partial class OpenApiV2Deserializer
151
155
{
152
156
OpenApiConstants . Enum ,
153
157
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
+ } ,
156
164
p => p . Schema )
157
165
} ,
158
166
} ;
You can’t perform that action at this time.
0 commit comments