File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Microsoft.OpenApi/Models Expand file tree Collapse file tree 1 file changed +4
-4
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 ;
@@ -156,10 +156,10 @@ protected override void SetAdditional31MetadataFromMapNode(JsonObject jsonObject
156156 }
157157
158158 // Extensions (properties starting with "x-")
159- foreach ( var property in jsonObject )
159+ foreach ( var property in jsonObject
160+ . Where ( static p => p . Key . StartsWith ( OpenApiConstants . ExtensionFieldNamePrefix , StringComparison . OrdinalIgnoreCase ) ) )
160161 {
161- if ( property . Key . StartsWith ( OpenApiConstants . ExtensionFieldNamePrefix , StringComparison . OrdinalIgnoreCase )
162- && property . Value is JsonNode extensionValue )
162+ if ( property . Value is JsonNode extensionValue )
163163 {
164164 Extensions ??= new Dictionary < string , IOpenApiExtension > ( StringComparer . OrdinalIgnoreCase ) ;
165165 Extensions [ property . Key ] = new JsonNodeExtension ( extensionValue . DeepClone ( ) ) ;
You can’t perform that action at this time.
0 commit comments