Skip to content

Breaking change Test-Json: Use JsonSchema.Net (System.Text.Json) instead of NJsonSchema (Newtonsoft.Json) #10122

Closed
@sdwheeler

Description

@sdwheeler

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

NJsonSchema only supports up to draft 7, which at this point is several years old and two versions behind. Additionally, it relies on Newtonsoft.Json. This change is a merely drop-in replacement of the implementation that provides validation.

Details

The cmdlet API doesn't change, however the cmdlet will no longer support draft 4 schemas. Draft 4 is a decade old at this point and the JSON Schema teamis encouraging tooling to only support draft 6/7 (6 is a subset of 7) and later.

To assist users in their migration away from draft 4, the alterschema draft migration tool has been created.

Articles

  • reference\7.4\Microsoft.PowerShell.Utility\Test-Json.md

Related Source Pull Requests

Related Source Issues

Metadata

Metadata

Assignees

Labels

area-utilityArea - Microsoft.PowerShell.Utility moduleissue-doc-ideaIssue - request for new content

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions