@@ -88,7 +88,7 @@ public override void Visit(OpenApiOperation operation)
8888 private static string ResolveVerbSegmentInOpertationId ( string operationId )
8989 {
9090 var charPos = operationId . LastIndexOf ( '.' , operationId . Length - 1 ) ;
91- if ( operationId . Contains ( '_' ) || charPos < 0 )
91+ if ( operationId . Contains ( '_' , StringComparison . OrdinalIgnoreCase ) || charPos < 0 )
9292 return operationId ;
9393 var newOperationId = new StringBuilder ( operationId ) ;
9494 newOperationId [ charPos ] = '_' ;
@@ -99,7 +99,7 @@ private static string ResolveVerbSegmentInOpertationId(string operationId)
9999 private static string ResolvePutOperationId ( string operationId )
100100 {
101101 return operationId . Contains ( DefaultPutPrefix , StringComparison . OrdinalIgnoreCase ) ?
102- operationId . Replace ( DefaultPutPrefix , PowerShellPutPrefix ) : operationId ;
102+ operationId . Replace ( DefaultPutPrefix , PowerShellPutPrefix , StringComparison . Ordinal ) : operationId ;
103103 }
104104
105105 private static string ResolveByRefOperationId ( string operationId )
@@ -191,19 +191,17 @@ private void AddAdditionalPropertiesToSchema(OpenApiSchema schema)
191191
192192 private static void ResolveOneOfSchema ( OpenApiSchema schema )
193193 {
194- if ( schema . OneOf ? . Any ( ) ?? false )
194+ if ( schema . OneOf ? . FirstOrDefault ( ) is { } newSchema )
195195 {
196- var newSchema = schema . OneOf . FirstOrDefault ( ) ;
197196 schema . OneOf = null ;
198197 FlattenSchema ( schema , newSchema ) ;
199198 }
200199 }
201200
202201 private static void ResolveAnyOfSchema ( OpenApiSchema schema )
203202 {
204- if ( schema . AnyOf ? . Any ( ) ?? false )
203+ if ( schema . AnyOf ? . FirstOrDefault ( ) is { } newSchema )
205204 {
206- var newSchema = schema . AnyOf . FirstOrDefault ( ) ;
207205 schema . AnyOf = null ;
208206 FlattenSchema ( schema , newSchema ) ;
209207 }
0 commit comments