Commit 417a9b5
committed
docs(skill): add null-clearing enum pattern example to Set template
Gemini round 3 MEDIUM finding: Pitfalls table mentions the
[AllowEmptyString] + '' sentinel + translate-to-$null pattern from
PR #401, but the Set template doesn't demonstrate it. A user
following the template literally would have to assemble the pieces
from the pitfalls row.
Added a dedicated "SET — null-clearing for enum string parameters"
subsection after the basic Set template showing the complete pattern
(Set-NBDCIMInterface-style) with:
- [AllowEmptyString()] + [ValidateSet(..., '')]
- $PSBoundParameters translation loop BEFORE BuildURIComponents
- Inline comment explaining why the translation order matters
Kept the basic Set template lean since null-clearing is opt-in for
specific parameters that need it — not all Set cmdlets do.
The [Nullable[bool]] suggestion in round 3 was rejected: the entire
repo uses [bool] on Set-* boolean API fields (verified across
Set-NBEventRule, Set-NBIPAMAddressRange, Set-NBDCIMDevice, etc.)
because BuildURIComponents iterates $PSBoundParameters which only
contains user-bound values — unbound [bool] defaults never leak into
the PATCH body. See PR comment for the empirical reasoning.1 parent 801afca commit 417a9b5
1 file changed
Lines changed: 54 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
178 | 232 | | |
179 | 233 | | |
180 | 234 | | |
| |||
0 commit comments