You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While verifying #409 against the live NetBox 4.5.7 OpenAPI schema (WritableDeviceWithConfigContextRequest), seven writable Device fields turned out to have no parameter on New-NBDCIMDevice or Set-NBDCIMDevice. All seven are nullable=true, so each one should be clearable via $null on the Set- variant from day one (consistent with the #409 pattern).
Following the #409 pattern — [T] on New-, [Nullable[T]] on Set- for integers/doubles; [string] on both for airflow with clearing via "" (standard PrimaryModel blank=True convention); [hashtable] on both for local_context_data.
Parameter
New-NBDCIMDevice
Set-NBDCIMDevice
Clearing
Location
[uint64]
[Nullable[uint64]]
-Location $null
Airflow
[ValidateSet(...)][string]
[ValidateSet(...)][string]
-Airflow '' (verify against schema — may need $null)
OOB_IP
[uint64]
[Nullable[uint64]]
-OOB_IP $null
Latitude
[double]
[Nullable[double]]
-Latitude $null
Longitude
[double]
[Nullable[double]]
-Longitude $null
Config_Template
[uint64]
[Nullable[uint64]]
-Config_Template $null
Local_Context_Data
[hashtable]
[hashtable]
-Local_Context_Data @{} (TBD — verify against schema)
Implementation notes
airflow null-clearing — schema says nullable=true but NetBox enums are historically blank=True strings. Before implementing, verify with a live PATCH whether "" or null clears it. See empty-string vs null clearing memory patterns.
airflow ValidateSet — run scripts/Verify-ValidateSetParity.ps1 -NetboxVersion v4.5.8 after adding. NetBox 4.6 GA may expand the set; gate on current version's values.
latitude / longitude precision — schema enforces decimal(5,2) and decimal(6,2) respectively. Use [double]; let server-side validation handle rounding / range.
Site stays [uint64] (nullable=false — Device must live somewhere).
Role / Device_Type / Status / Face stay unchanged (all nullable=false).
Position precision bug ([uint16] → [double]) — tracked separately because it crosses more than just the Device scope.
Context
Original observation documented in the comment on #409. @mkarel expressed interest in contributing this one — assigning first right of refusal. If it's stale for ~2-3 days we'll pick it up on this side with Co-Authored-By credit per established pattern.
Follow-up from #409.
While verifying #409 against the live NetBox 4.5.7 OpenAPI schema (
WritableDeviceWithConfigContextRequest), seven writable Device fields turned out to have no parameter onNew-NBDCIMDeviceorSet-NBDCIMDevice. All seven arenullable=true, so each one should be clearable via$nullon theSet-variant from day one (consistent with the #409 pattern).Missing fields
locationairflowfront-to-rear,rear-to-front,left-to-right,right-to-left,side-to-rear,passive,mixed. Needs[ValidateSet]+ parity check viascripts/Verify-ValidateSetParity.ps1oob_iplatitude[double]/[Nullable[double]]— not integerlongitude[double]/[Nullable[double]]— not integerconfig_templatelocal_context_data[hashtable]/[object]Proposed parameter types
Following the #409 pattern —
[T]onNew-,[Nullable[T]]onSet-for integers/doubles;[string]on both forairflowwith clearing via""(standard PrimaryModelblank=Trueconvention);[hashtable]on both forlocal_context_data.New-NBDCIMDeviceSet-NBDCIMDeviceLocation[uint64][Nullable[uint64]]-Location $nullAirflow[ValidateSet(...)][string][ValidateSet(...)][string]-Airflow ''(verify against schema — may need$null)OOB_IP[uint64][Nullable[uint64]]-OOB_IP $nullLatitude[double][Nullable[double]]-Latitude $nullLongitude[double][Nullable[double]]-Longitude $nullConfig_Template[uint64][Nullable[uint64]]-Config_Template $nullLocal_Context_Data[hashtable][hashtable]-Local_Context_Data @{}(TBD — verify against schema)Implementation notes
airflownull-clearing — schema saysnullable=truebut NetBox enums are historicallyblank=Truestrings. Before implementing, verify with a livePATCHwhether""ornullclears it. See empty-string vs null clearing memory patterns.airflowValidateSet — runscripts/Verify-ValidateSetParity.ps1 -NetboxVersion v4.5.8after adding. NetBox 4.6 GA may expand the set; gate on current version's values.latitude/longitudeprecision — schema enforcesdecimal(5,2)anddecimal(6,2)respectively. Use[double]; let server-side validation handle rounding / range.$nullassertion per nullable parameter, one happy-path assertion, one ValidateSet rejection forairflow.Out of scope
Sitestays[uint64](nullable=false— Device must live somewhere).Role/Device_Type/Status/Facestay unchanged (allnullable=false).[uint16]→[double]) — tracked separately because it crosses more than just the Device scope.Context
Original observation documented in the comment on #409. @mkarel expressed interest in contributing this one — assigning first right of refusal. If it's stale for ~2-3 days we'll pick it up on this side with Co-Authored-By credit per established pattern.
Targets v4.6.0 (accumulator branch on
dev).