diff --git a/compile-to-definitions/index.js b/compile-to-definitions/index.js index 3cb1ef2..8388fdd 100644 --- a/compile-to-definitions/index.js +++ b/compile-to-definitions/index.js @@ -101,6 +101,16 @@ const resolvePath = (root, ref) => { }; const preprocessSchema = (schema, root = schema, path = []) => { + if (schema.experimental) { + const experimental = + typeof schema.experimental === "string" + ? `@experimental ${schema.experimental}` + : "@experimental"; + schema.description = schema.description + ? `${schema.description}\n${experimental}` + : experimental; + delete schema.experimental; + } if ("definitions" in schema) { for (const key of Object.keys(schema.definitions)) { preprocessSchema(schema.definitions[key], root, [key]); diff --git a/format-schemas/index.js b/format-schemas/index.js index 362f283..58d6c77 100644 --- a/format-schemas/index.js +++ b/format-schemas/index.js @@ -113,6 +113,8 @@ const PROPERTIES = [ "tsType", "deprecated", + + "experimental", ]; const processJson = processSchema.bind(null, { diff --git a/precompile-schemas/index.js b/precompile-schemas/index.js index 4898bd7..90b5949 100644 --- a/precompile-schemas/index.js +++ b/precompile-schemas/index.js @@ -110,6 +110,7 @@ const EXCLUDED_PROPERTIES = [ "title", "description", "deprecated", + "experimental", "cli", "implements", "tsType", diff --git a/schemas-lint/index.js b/schemas-lint/index.js index aeb321b..a1e7e96 100644 --- a/schemas-lint/index.js +++ b/schemas-lint/index.js @@ -51,6 +51,7 @@ for (const filename of schemas) { "not", "link", "deprecated", + "experimental", ]; const isReference = (schema) => {