Skip to content

Commit 4c95bb6

Browse files
committed
fix ordering issue with subscription comparison
1 parent bb7e22c commit 4c95bb6

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/integration/all-resource-types/Compare-ApimInstance.ps1

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,12 @@ function Build-ResourceMap {
166166
}
167167
}
168168

169-
# Sort auto-ID items by their normalised JSON so equivalent schemas/operations
170-
# from source and target receive the same positional key ({{auto-id-0}}, etc.)
169+
# Sort auto-ID items by canonical normalized resource JSON (same normalization
170+
# pipeline used for diffing) so positional keys remain stable across instances.
171171
if ($autoIdItems.Count -gt 0) {
172172
$sorted = $autoIdItems | Sort-Object {
173-
$normVal = ConvertTo-NormalizedPropertyValue -Value $_ `
174-
-SourceName $SourceName -TargetName $TargetName `
175-
-SourceSub $SourceSub -TargetSub $TargetSub `
176-
-SourceRg $SourceRg -TargetRg $TargetRg
177-
$normVal | ConvertTo-Json -Depth 50 -Compress
173+
$normResource = ConvertTo-NormalizedResource -Resource $_
174+
$normResource | ConvertTo-Json -Depth 50 -Compress
178175
}
179176
$i = 0
180177
foreach ($item in $sorted) {

0 commit comments

Comments
 (0)