Normalise a JSON Schema to canonical Draft 2020-12 form.
Deep-clones the input — the original is never mutated.
When diagnostics is supplied, per-node transforms emit diagnostics
for legacy-keyword rewrites and invalid constructs (e.g. divisibleBy
conflicts, non-string entries in a dependentRequired array, legacy
dependencies reaching the 2020-12 path).
Normalise a JSON Schema to canonical Draft 2020-12 form. Deep-clones the input — the original is never mutated.
When
diagnosticsis supplied, per-node transforms emit diagnostics for legacy-keyword rewrites and invalid constructs (e.g.divisibleByconflicts, non-string entries in adependentRequiredarray, legacydependenciesreaching the 2020-12 path).