-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
According to #7436 ConvertFrom-Json should support "JSONC"-style comments present in JSON objects without issue.
However this doesn't seem to work if the comments are in a "top level" array - instead the comments are interpreted as strings-elements within the array.
Steps to reproduce
ConvertFrom-Json -NoEnumerate "[`n// foo`n 100, `n /* bar */`n 200]" | ConvertTo-Json -Compress
Expected behavior
Either an error (due to comments not being supported) or:
[100,200]
Actual behavior
[" foo",100," bar ",200]
Environment data
Name Value
---- -----
PSVersion 7.2.0-preview.2
PSEdition Core
GitCommitId 7.2.0-preview.2
OS Linux 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
mklement0, thielj, geekzter, pmalmsten, odegroot and 2 more
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module