Skip to content

Commit df5c13b

Browse files
committed
Merge branch 'dev' into WeeklyOpenAPIDocsUpdate
2 parents f6a28e3 + 46d16fa commit df5c13b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/TweakOpenApi.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Param(
99

1010
$TargetWord = "ByRef"
1111
$ReplacementWord = "GraphRef"
12+
$actionPattern = [Regex]::new("(_[A-Z][a-z]+)", "Compiled")
1213
$Stopwatch = [system.diagnostics.stopwatch]::StartNew()
1314
Get-ChildItem -Path $OpenAPIFilesPath | ForEach-Object {
1415
$filePath = $_.FullName
@@ -19,9 +20,8 @@ Get-ChildItem -Path $OpenAPIFilesPath | ForEach-Object {
1920
$operationId = $_
2021
# Matches '_{ActionName}' in operationIds formatted as '{entitySet}_{ActionName}{NavigationProperty}'. e.g.,
2122
# For 'applications_GetCreatedOnBehalfOfByRef', we will match '_Get'.
22-
$actionPattern = [Regex]::new("(_[A-Z][a-z]+)", "Compiled")
2323
$match = $actionPattern.Match($operationId)
24-
if ($match -ne $null -and $match.Success) {
24+
if ($null -ne $match -and $match.Success) {
2525
$operationId = $operationId.Replace($TargetWord, "")
2626
# Suffix matched '_{ActionName}' with 'GraphRef'. GraphRef will be our safe unique word for identifying *ByRef commands in PowerShell e.g.,
2727
# 'applications_GetCreatedOnBehalfOfByRef' will be renamed to 'applications_GetGraphRefCreatedOnBehalfOf'.

0 commit comments

Comments
 (0)