@@ -23,15 +23,15 @@ internal class PowerShellFormatter : OpenApiVisitorBase
23
23
static PowerShellFormatter ( )
24
24
{
25
25
// Add singularization exclusions.
26
- // TODO : Read exclusions from a user provided file.
26
+ // Enhancement : Read exclusions from a user provided file.
27
27
Vocabularies . Default . AddSingular ( "(drive)s$" , "$1" ) ; // drives does not properly singularize to drive.
28
28
Vocabularies . Default . AddSingular ( "(data)$" , "$1" ) ; // exclude the following from singularization.
29
29
Vocabularies . Default . AddSingular ( "(delta)$" , "$1" ) ;
30
30
Vocabularies . Default . AddSingular ( "(quota)$" , "$1" ) ;
31
31
Vocabularies . Default . AddSingular ( "(statistics)$" , "$1" ) ;
32
32
}
33
33
34
- //TODO: FHL taks for PS
34
+ //FHL task for PS
35
35
// Fixes (Order matters):
36
36
// 1. Singularize operationId operationIdSegments.
37
37
// 2. Add '_' to verb in an operationId.
@@ -64,7 +64,7 @@ public override void Visit(OpenApiPathItem pathItem)
64
64
public override void Visit ( OpenApiOperation operation )
65
65
{
66
66
if ( string . IsNullOrWhiteSpace ( operation . OperationId ) )
67
- throw new ArgumentException ( nameof ( operation ) , $ "OperationId is required { PathString } ") ;
67
+ throw new ArgumentException ( $ "OperationId is required { PathString } ", nameof ( operation ) ) ;
68
68
69
69
var operationId = operation . OperationId ;
70
70
var operationTypeExtension = operation . Extensions . GetExtension ( "x-ms-docs-operation-type" ) ;
@@ -128,7 +128,7 @@ private static string SingularizeAndDeduplicateOperationId(IList<string> operati
128
128
129
129
// If a segment name is contained in the previous segment, the latter is considered a duplicate.
130
130
// The last segment is ignored as a rule.
131
- if ( ( x > 0 && x < lastSegmentIndex ) && singularizedSegments . Last ( ) . Equals ( segment , StringComparison . OrdinalIgnoreCase ) )
131
+ if ( ( x > 0 && x < lastSegmentIndex ) && singularizedSegments [ singularizedSegments . Count - 1 ] . Equals ( segment , StringComparison . OrdinalIgnoreCase ) )
132
132
continue ;
133
133
134
134
singularizedSegments . Add ( segment ) ;
0 commit comments