From 7d45c346bbdf643a93d0247fee9f91c06b24aec7 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Sun, 6 Apr 2025 19:19:36 +0200 Subject: [PATCH] doc: allow the $schema property in node.config.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation states people can use the `$schema` property, but the JSON schema forbids this. This change allows it. PR-URL: https://github.com/nodejs/node/pull/57560 Reviewed-By: Marco Ippolito Reviewed-By: Colin Ihrig Reviewed-By: Yagiz Nizipli Reviewed-By: Ulises Gascón Reviewed-By: Jordan Harband Reviewed-By: Moshe Atlow Reviewed-By: Trivikram Kamat Reviewed-By: Pietro Marchini Reviewed-By: James M Snell --- doc/node-config-schema.json | 3 +++ lib/internal/options.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/doc/node-config-schema.json b/doc/node-config-schema.json index 8430a086d28..ca10429ef57 100644 --- a/doc/node-config-schema.json +++ b/doc/node-config-schema.json @@ -2,6 +2,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "properties": { + "$schema": { + "type": "string" + }, "nodeOptions": { "additionalProperties": false, "properties": { diff --git a/lib/internal/options.js b/lib/internal/options.js index efc3ff3c30c..12548ac49a2 100644 --- a/lib/internal/options.js +++ b/lib/internal/options.js @@ -45,6 +45,10 @@ function generateConfigJsonSchema() { $schema: 'https://json-schema.org/draft/2020-12/schema', additionalProperties: false, properties: { + $schema: { + __proto__: null, + type: 'string', + }, nodeOptions: { __proto__: null, additionalProperties: false,