@@ -88,7 +88,7 @@ public override void Visit(OpenApiOperation operation)
88
88
private static string ResolveVerbSegmentInOpertationId ( string operationId )
89
89
{
90
90
var charPos = operationId . LastIndexOf ( '.' , operationId . Length - 1 ) ;
91
- if ( operationId . Contains ( '_' ) || charPos < 0 )
91
+ if ( operationId . Contains ( '_' , StringComparison . OrdinalIgnoreCase ) || charPos < 0 )
92
92
return operationId ;
93
93
var newOperationId = new StringBuilder ( operationId ) ;
94
94
newOperationId [ charPos ] = '_' ;
@@ -99,7 +99,7 @@ private static string ResolveVerbSegmentInOpertationId(string operationId)
99
99
private static string ResolvePutOperationId ( string operationId )
100
100
{
101
101
return operationId . Contains ( DefaultPutPrefix , StringComparison . OrdinalIgnoreCase ) ?
102
- operationId . Replace ( DefaultPutPrefix , PowerShellPutPrefix ) : operationId ;
102
+ operationId . Replace ( DefaultPutPrefix , PowerShellPutPrefix , StringComparison . Ordinal ) : operationId ;
103
103
}
104
104
105
105
private static string ResolveByRefOperationId ( string operationId )
@@ -191,19 +191,17 @@ private void AddAdditionalPropertiesToSchema(OpenApiSchema schema)
191
191
192
192
private static void ResolveOneOfSchema ( OpenApiSchema schema )
193
193
{
194
- if ( schema . OneOf ? . Any ( ) ?? false )
194
+ if ( schema . OneOf ? . FirstOrDefault ( ) is { } newSchema )
195
195
{
196
- var newSchema = schema . OneOf . FirstOrDefault ( ) ;
197
196
schema . OneOf = null ;
198
197
FlattenSchema ( schema , newSchema ) ;
199
198
}
200
199
}
201
200
202
201
private static void ResolveAnyOfSchema ( OpenApiSchema schema )
203
202
{
204
- if ( schema . AnyOf ? . Any ( ) ?? false )
203
+ if ( schema . AnyOf ? . FirstOrDefault ( ) is { } newSchema )
205
204
{
206
- var newSchema = schema . AnyOf . FirstOrDefault ( ) ;
207
205
schema . AnyOf = null ;
208
206
FlattenSchema ( schema , newSchema ) ;
209
207
}
0 commit comments