File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
src/JsonApiDotNetCore.OpenApi.Client.NSwag
test/OpenApiTests/NamingConventions/KebabCase Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 33using SysNotNull = System . Diagnostics . CodeAnalysis . NotNullAttribute ;
44
55#pragma warning disable AV1008 // Class should not be static
6+ #pragma warning disable format
67
78namespace JsonApiDotNetCore . OpenApi . Client . NSwag ;
89
910internal static class ArgumentGuard
1011{
1112 [ AssertionMethod ]
12- public static void NotNull < T > ( [ NoEnumeration ] [ SysNotNull ] T ? value , [ CallerArgumentExpression ( " value" ) ] string ? parameterName = null )
13+ public static void NotNull < T > ( [ NoEnumeration ] [ SysNotNull ] T ? value , [ CallerArgumentExpression ( nameof ( value ) ) ] string ? parameterName = null )
1314 where T : class
1415 {
1516 ArgumentNullException . ThrowIfNull ( value , parameterName ) ;
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ public override string ConvertName(string name)
3636
3737 if ( position + 1 != spanName . Length )
3838 {
39- isNextLower = spanName [ position + 1 ] > 96 && spanName [ position + 1 ] < 123 ;
40- isNextUpper = spanName [ position + 1 ] > 64 && spanName [ position + 1 ] < 91 ;
41- isNextSpace = spanName [ position + 1 ] == 32 ;
39+ isNextLower = spanName [ position + 1 ] is >= 'a' and <= 'z' ;
40+ isNextUpper = spanName [ position + 1 ] is >= 'A' and <= 'Z' ;
41+ isNextSpace = spanName [ position + 1 ] == ' ' ;
4242 }
4343
4444 if ( isCurrentSpace && ( isPreviousSpace || isPreviousSeparator || isNextUpper || isNextSpace ) )
@@ -47,9 +47,9 @@ public override string ConvertName(string name)
4747 }
4848 else
4949 {
50- bool isCurrentUpper = spanName [ position ] > 64 && spanName [ position ] < 91 ;
51- bool isPreviousLower = spanName [ position - 1 ] > 96 && spanName [ position - 1 ] < 123 ;
52- bool isPreviousNumber = spanName [ position - 1 ] > 47 && spanName [ position - 1 ] < 58 ;
50+ bool isCurrentUpper = spanName [ position ] is >= 'A' and <= 'Z' ;
51+ bool isPreviousLower = spanName [ position - 1 ] is >= 'a' and <= 'z' ;
52+ bool isPreviousNumber = spanName [ position - 1 ] is >= '0' and <= '9' ;
5353
5454 if ( isCurrentUpper && ( isPreviousLower || isPreviousNumber || isNextLower || isNextSpace ) )
5555 {
@@ -76,6 +76,6 @@ public override string ConvertName(string name)
7676 }
7777 }
7878
79- return stringBuilder . ToString ( ) . ToLower ( ) ;
79+ return stringBuilder . ToString ( ) . ToLowerInvariant ( ) ;
8080 }
8181}
You can’t perform that action at this time.
0 commit comments