File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/Microsoft.OpenApi/Validations/Rules Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 22// Licensed under the MIT license.
33
44using System ;
5+ using System . Linq ;
56using Microsoft . OpenApi . Interfaces ;
67using Microsoft . OpenApi . Properties ;
78
@@ -21,13 +22,10 @@ public static class OpenApiExtensibleRules
2122 ( context , item ) =>
2223 {
2324 context . Enter ( "extensions" ) ;
24- foreach ( var extensible in item . Extensions )
25+ foreach ( var extensible in item . Extensions . Keys . Where ( static x => ! x . StartsWith ( "x-" , StringComparison . OrdinalIgnoreCase ) ) )
2526 {
26- if ( ! extensible . Key . StartsWith ( "x-" ) )
27- {
28- context . CreateError ( nameof ( ExtensionNameMustStartWithXDash ) ,
29- String . Format ( SRResource . Validation_ExtensionNameMustBeginWithXDash , extensible . Key , context . PathString ) ) ;
30- }
27+ context . CreateError ( nameof ( ExtensionNameMustStartWithXDash ) ,
28+ string . Format ( SRResource . Validation_ExtensionNameMustBeginWithXDash , extensible , context . PathString ) ) ;
3129 }
3230 context . Exit ( ) ;
3331 } ) ;
You can’t perform that action at this time.
0 commit comments