Skip to content

Commit 7b42e36

Browse files
fix: exempt enum null-clearing sentinel '' from parity tool (#401 follow-up) (#402)
PR #401 added '' to the ValidateSet of -Duplex, -POE_Mode, -POE_Type, and -RF_Role on Set-NBDCIMInterface as an empty-string sentinel. The sentinel is translated to \$null in process {} before JSON body serialization, so NetBox sees {"field": null} and clears the value. scripts/Verify-ValidateSetParity.ps1 has no way to know the '' is a PowerNetbox-internal clearing marker rather than a real value, so it flagged these as 'Extra in PowerNetbox'. That's expected, not a bug — add four exemptions with an explanatory comment pointing at PR #401. Also adds RF_Role preventively: it doesn't currently surface in the parity output (score below match threshold) but uses the same sentinel pattern, so if a future NetBox change shifts the score above threshold the exemption is already in place. Tool output: 8 -> 5 findings against both v4.5.8 and v4.6.0-beta1 (the 5 remaining are the pre-existing #392 catalog-adds plus the known Get-NBBranch wrong-class match).
1 parent ecc3fb8 commit 7b42e36

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/validateset-parity-exclusions.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ Extras/CustomLinks/Set-NBCustomLink.ps1::Button_Class
4444
# '100', '200', '300', '400' — translate to: 'access', 'tagged', 'tagged-all', 'q-in-q'.
4545
DCIM/Interfaces/New-NBDCIMInterface.ps1::Mode
4646
DCIM/Interfaces/Set-NBDCIMInterface.ps1::Mode
47+
48+
# ---------------------------------------------------------------------------
49+
# Parameters that include '' as an empty-string sentinel for null-clearing
50+
# on PATCH. Translated to $null in process {} before the JSON body is built
51+
# (see PR #401 — Set-NBDCIMInterface enum null-clearing follow-up to PR #398).
52+
# The '' is a PowerNetbox UX choice, not a value NetBox actually accepts —
53+
# so the parity tool flags it as "Extra in PowerNetbox". That's expected.
54+
# ---------------------------------------------------------------------------
55+
DCIM/Interfaces/Set-NBDCIMInterface.ps1::Duplex
56+
DCIM/Interfaces/Set-NBDCIMInterface.ps1::POE_Mode
57+
DCIM/Interfaces/Set-NBDCIMInterface.ps1::POE_Type
58+
DCIM/Interfaces/Set-NBDCIMInterface.ps1::RF_Role

0 commit comments

Comments
 (0)