@@ -56,18 +56,7 @@ public static OpenApiDocument LoadOpenApi(RootNode rootNode)
5656
5757 public static PatternFieldMap < OpenApiInfo > InfoPatternFields = new PatternFieldMap < OpenApiInfo >
5858 {
59- {
60- ( s ) => s . StartsWith ( "x-" ) ,
61- ( o , k , n ) =>
62- {
63- if ( o . Extensions == null )
64- {
65- o . Extensions = new Dictionary < string , IOpenApiAny > ( ) ;
66- }
67-
68- o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) ;
69- }
70- }
59+ { ( s ) => s . StartsWith ( "x-" ) , ( o , k , n ) => o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) }
7160 } ;
7261
7362 public static OpenApiInfo LoadInfo ( ParseNode node )
@@ -95,18 +84,7 @@ public static OpenApiInfo LoadInfo(ParseNode node)
9584
9685 public static PatternFieldMap < OpenApiContact > ContactPatternFields = new PatternFieldMap < OpenApiContact >
9786 {
98- {
99- ( s ) => s . StartsWith ( "x-" ) ,
100- ( o , k , n ) =>
101- {
102- if ( o . Extensions == null )
103- {
104- o . Extensions = new Dictionary < string , IOpenApiAny > ( ) ;
105- }
106-
107- o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) ;
108- }
109- }
87+ { ( s ) => s . StartsWith ( "x-" ) , ( o , k , n ) => o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) }
11088 } ;
11189
11290 public static OpenApiContact LoadContact ( ParseNode node )
@@ -130,18 +108,7 @@ public static OpenApiContact LoadContact(ParseNode node)
130108
131109 public static PatternFieldMap < OpenApiLicense > LicensePatternFields = new PatternFieldMap < OpenApiLicense >
132110 {
133- {
134- ( s ) => s . StartsWith ( "x-" ) ,
135- ( o , k , n ) =>
136- {
137- if ( o . Extensions == null )
138- {
139- o . Extensions = new Dictionary < string , IOpenApiAny > ( ) ;
140- }
141-
142- o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) ;
143- }
144- }
111+ { ( s ) => s . StartsWith ( "x-" ) , ( o , k , n ) => o . Extensions . Add ( k , new OpenApiString ( n . GetScalarValue ( ) ) ) }
145112 } ;
146113
147114 internal static OpenApiLicense LoadLicense ( ParseNode node )
0 commit comments