Repository navigation
Test-Json cmdlet (JSON lint/validator) #4220
Copy link
Copy link
Closed
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.
Milestone
Description
Activity
- addedIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bug
on Jul 11, 2017 - changed the title
[-]Test-Json cmdlet (JSON lint)[/-][+]Test-Json cmdlet (JSON lint/validator)[/+]on Jul 11, 2017 Along these lines, how about a
Test-Xml/Format-Xmlset of cmdlets? These are implemented in PSCX in C# and could probably be ported over now that .NET Core 2 has support for XML Schema. TheTest-Xmlcmdlet's utility is fairly self-evident but perhaps that is less so withFormat-Xml. The latter command is very handy when you have an XML file that is a single line and 4000 chars wide. :-) It is also handy when attributes are scattered about. A formatter can also put attributes on a new line. In general it makes the XML output easier to read e.g.:gc foo.xml <?xml version="1.0"?><doc><assembly><name>VBFormsApp</name></assembly><members></members></doc>becomes:
format-xml foo.xml <?xml version="1.0"?> <doc> <assembly> <name>VBFormsApp</name> </assembly> <members></members> </doc>Reacted by Troy Campbell, Joey Aiello and Meir BlachmanI would also love to see a Test-Json, Test-XML, and Format-XML as part of baseline Powershell. Looks like the Test-Json is well underway
- added a commit that references this issue
on Mar 26, 2018 - added a commit that references this issue
on Apr 24, 2018 - addedIn-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issue
on Jul 17, 2026 - added a commit that references this issue
on Aug 6, 2026
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.
Placeholder for now as I follow up on some customer scenarios: it would be really nice to have a cmdlet that could validate JSON before it's used as input. I'd expect for something like this to already exist in Newtonsoft.Json.
IMHO, it's a nice-to-have for 6.0.0 depending on how we're looking with
HighPriorityover the next couple months. If not, we could move it out to 6.1.0 without a real problem.Also, this would require an RFC.