@@ -51,25 +51,25 @@ static async Task Main(string[] args)
51
51
_schemaDefinitionsInMultipleGroups = _schemaToNameMap . Values . Select ( x =>
52
52
{
53
53
var parts = x . Split ( "." ) ;
54
- return new { FullName = x , Name = parts [ parts . Length - 1 ] , Version = parts [ parts . Length - 2 ] , Group = parts [ parts . Length - 3 ] } ;
54
+ return new { FullName = x , Name = parts [ parts . Length - 1 ] , Version = parts [ parts . Length - 2 ] , Group = parts [ parts . Length - 3 ] } ;
55
55
} )
56
- . GroupBy ( x => new { x . Name , x . Version } )
56
+ . GroupBy ( x => new { x . Name , x . Version } )
57
57
. Where ( x => x . Count ( ) > 1 )
58
58
. SelectMany ( x => x )
59
59
. Select ( x => x . FullName )
60
60
. ToHashSet ( ) ;
61
61
62
62
_classNameToPluralMap = swagger . Operations
63
63
. Where ( x => x . Operation . OperationId . StartsWith ( "list" ) )
64
- . Select ( x => { return new { PluralName = x . Path . Split ( "/" ) . Last ( ) , ClassName = GetClassNameForSchemaDefinition ( x . Operation . Responses [ "200" ] . ActualResponseSchema ) } ; } )
64
+ . Select ( x => { return new { PluralName = x . Path . Split ( "/" ) . Last ( ) , ClassName = GetClassNameForSchemaDefinition ( x . Operation . Responses [ "200" ] . ActualResponseSchema ) } ; } )
65
65
. Distinct ( )
66
66
. ToDictionary ( x => x . ClassName , x => x . PluralName ) ;
67
67
68
68
// dictionary only contains "list" plural maps. assign the same plural names to entities those lists support
69
69
_classNameToPluralMap = _classNameToPluralMap
70
70
. Where ( x => x . Key . EndsWith ( "List" ) )
71
71
. Select ( x =>
72
- new { ClassName = x . Key . Remove ( x . Key . Length - 4 ) , PluralName = x . Value } )
72
+ new { ClassName = x . Key . Remove ( x . Key . Length - 4 ) , PluralName = x . Value } )
73
73
. ToDictionary ( x => x . ClassName , x => x . PluralName )
74
74
. Union ( _classNameToPluralMap )
75
75
. ToDictionary ( x => x . Key , x => x . Value ) ;
@@ -119,7 +119,7 @@ static async Task Main(string[] args)
119
119
120
120
var modelsDir = Path . Combine ( outputDirectory , "Models" ) ;
121
121
_classesWithValidation = Directory . EnumerateFiles ( modelsDir )
122
- . Select ( x => new { Class = Path . GetFileNameWithoutExtension ( x ) , Content = File . ReadAllText ( x ) } )
122
+ . Select ( x => new { Class = Path . GetFileNameWithoutExtension ( x ) , Content = File . ReadAllText ( x ) } )
123
123
. Where ( x => x . Content . Contains ( "public virtual void Validate()" ) )
124
124
. Select ( x => x . Class )
125
125
. ToHashSet ( ) ;
@@ -244,7 +244,7 @@ static string GetInterfaceName(JsonSchema4 definition)
244
244
interfaces . Add ( $ "ISpec<{ GetClassNameForSchemaDefinition ( specProperty . Reference ) } >") ;
245
245
}
246
246
247
- if ( _classesWithValidation . Contains ( className ) )
247
+ if ( _classesWithValidation . Contains ( className ) )
248
248
interfaces . Add ( "IValidate" ) ;
249
249
var result = string . Join ( ", " , interfaces ) ;
250
250
return result ;
@@ -272,7 +272,7 @@ static void GetPlural(RenderContext context, IList<object> arguments, IDictionar
272
272
if ( arguments != null && arguments . Count > 0 && arguments [ 0 ] != null && arguments [ 0 ] is JsonSchema4 )
273
273
{
274
274
var plural = GetPlural ( arguments [ 0 ] as JsonSchema4 ) ;
275
- if ( plural != null )
275
+ if ( plural != null )
276
276
context . Write ( $ "\" { plural } \" ") ;
277
277
else
278
278
context . Write ( "null" ) ;
0 commit comments