-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Steps to reproduce
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json- Add
$idand$typeproperties to a json object - Pipe object to
ConvertFrom-JsonCmdlet - Notice that
$idand$typeproperties are missing from resultingPSCustomObject
Expected behavior
ConvertFrom-Json does not ignore properties when deserializing into generic PSCustomObject, regardless of their name.
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json
$id $type id
--- ----- --
1 System.String valueActual behavior
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json
id
--
valueAdditional Notes
- Issue does not occur when metadata properties are deeper in the hierarchy.
- Other
Newtonsoft.Jsonmetadata properties include$valuesand$ref.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.3
PSEdition Core
GitCommitId v6.1.0-preview.3
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module