File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/Microsoft.OpenApi/Models Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,12 @@ protected override void SetAdditional31MetadataFromMapNode(JsonObject jsonObject
157157
158158 // Extensions (properties starting with "x-")
159159 foreach ( var property in jsonObject
160- . Where ( static p => p . Key . StartsWith ( OpenApiConstants . ExtensionFieldNamePrefix , StringComparison . OrdinalIgnoreCase ) ) )
160+ . Where ( static p => p . Key . StartsWith ( OpenApiConstants . ExtensionFieldNamePrefix , StringComparison . OrdinalIgnoreCase ) )
161+ . Where ( static p => p . Value is JsonNode ) )
161162 {
162- if ( property . Value is JsonNode extensionValue )
163- {
164- Extensions ??= new Dictionary < string , IOpenApiExtension > ( StringComparer . OrdinalIgnoreCase ) ;
165- Extensions [ property . Key ] = new JsonNodeExtension ( extensionValue . DeepClone ( ) ) ;
166- }
163+ var extensionValue = ( JsonNode ) property . Value ! ;
164+ Extensions ??= new Dictionary < string , IOpenApiExtension > ( StringComparer . OrdinalIgnoreCase ) ;
165+ Extensions [ property . Key ] = new JsonNodeExtension ( extensionValue . DeepClone ( ) ) ;
167166 }
168167 }
169168}
You can’t perform that action at this time.
0 commit comments