Skip to content

Make ConvertTo-Json treat [AutomationNull]::Value and [NullString]::Value as $null - #10957

Merged
Andrew (anmenaga) merged 3 commits into
PowerShell:masterfrom
daxian-dbw:json
Nov 5, 2019
Merged

Andrew (anmenaga) merged 3 commits into
PowerShell:masterfrom
daxian-dbw:json

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Oct 31, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Fix #9231

Make ConvertTo-Json treat [AutomationNull]::Value and [NullString]::Value as $null

This is a breaking change given the fact that [AutomationNull]::Value and [NullString]::Value are deserailized into an empty object {} today and will be null after this change.
However, it's hard to believe anyone is depending on the current wrong behavior.

PR Checklist

@daxian-dbw

Copy link
Copy Markdown
Member Author

Rebased to resolve conflicts.

@daxian-dbw

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) Please retry static

@daxian-dbw

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) Please retry linux

@PoshChan

Copy link
Copy Markdown
Collaborator

Dongbo Wang (@daxian-dbw), successfully started retry of PowerShell-CI-Linux

@PoshChan

Copy link
Copy Markdown
Collaborator

Dongbo Wang (@daxian-dbw), successfully started retry of PowerShell-CI-static-analysis

@anmenaga Andrew (anmenaga) added this to the 7.0.0-preview.6 milestone Nov 5, 2019
@anmenaga Andrew (anmenaga) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 5, 2019
@anmenaga
Andrew (anmenaga) merged commit 518a479 into PowerShell:master Nov 5, 2019
@ghost

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConvertTo-Json unexpectedly serializes AutomationValue.Null as an empty object, not null

4 participants