@@ -16,7 +16,7 @@ $prepositionReplacements = @{
16
16
At = " GraphAPre"
17
17
For = " GraphFPre"
18
18
Of = " GraphOPre"
19
- Or = " GraphRPre"
19
+ # Or = "GraphRPre" Handling of this preposition needs to be reviewed
20
20
}
21
21
22
22
$wordReplacements = @ {
@@ -33,26 +33,24 @@ Get-ChildItem -Path $OpenAPIFilesPath | ForEach-Object {
33
33
$updatedContent = Get-Content $filePath | ForEach-Object {
34
34
if ($_.contains (" operationId:" )) {
35
35
$operationId = $_
36
- # For the OR preposition, we need to check if the operationId contains 'Org' as it is a reserved word.
37
- if (-not ($operationId -contains " Org" )) {
38
- $wordReplacements.Keys | ForEach-Object {
39
- if ($operationId.EndsWith ($_ , " CurrentCultureIgnoreCase" )) {
40
- $operationId = ($operationId -replace $_ , $wordReplacements [$_ ])
41
- $modified = $true
42
- Write-Debug " $_ -> $operationId " .Trim()
43
- }
36
+ $wordReplacements.Keys | ForEach-Object {
37
+ if ($operationId.EndsWith ($_ , " CurrentCultureIgnoreCase" )) {
38
+ $operationId = ($operationId -replace $_ , $wordReplacements [$_ ])
39
+ $modified = $true
40
+ Write-Debug " $_ -> $operationId " .Trim()
44
41
}
42
+ }
45
43
46
- if (($targetOperationIdRegex.Match ($_ )).Success) {
47
- $prepositionReplacements.Keys | ForEach-Object {
48
- # Replace prepositions with replacement word.
49
- # e.g., 'applications_GetCreatedOnBehalfOfByRef' will be renamed to 'applications_GetCreatedOnBehalfGraphOPreGraphBPreRef'.
50
- $operationId = ($operationId -creplace $_ , $prepositionReplacements [$_ ])
51
- $modified = $true
52
- Write-Debug " $_ -> $operationId " .Trim()
53
- }
44
+ if (($targetOperationIdRegex.Match ($_ )).Success) {
45
+ $prepositionReplacements.Keys | ForEach-Object {
46
+ # Replace prepositions with replacement word.
47
+ # e.g., 'applications_GetCreatedOnBehalfOfByRef' will be renamed to 'applications_GetCreatedOnBehalfGraphOPreGraphBPreRef'.
48
+ $operationId = ($operationId -creplace $_ , $prepositionReplacements [$_ ])
49
+ $modified = $true
50
+ Write-Debug " $_ -> $operationId " .Trim()
54
51
}
55
52
}
53
+
56
54
return $operationId
57
55
}
58
56
0 commit comments