From edaef816939c9fbfc1e7ce033e277810dbf1c199 Mon Sep 17 00:00:00 2001 From: Jacques Yakoub Date: Sat, 23 Aug 2025 19:20:05 +0200 Subject: [PATCH] feat: defaultExpandDepth --- .../src/lib/services/jsv-options.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/projects/ngx-json-schema-viewer/src/lib/services/jsv-options.ts b/projects/ngx-json-schema-viewer/src/lib/services/jsv-options.ts index 0b05522..9d871de 100644 --- a/projects/ngx-json-schema-viewer/src/lib/services/jsv-options.ts +++ b/projects/ngx-json-schema-viewer/src/lib/services/jsv-options.ts @@ -34,6 +34,16 @@ export type JSVOptions = { * @default ["nullable","deprecated","readOnly","writeOnly","enum","stringLength","objectProperties","no-extra-properties","arrayItems","arrayContains","no-extra-items","number-range","pattern","multipleOf","uniqueItems","contentEncoding","contentMediaType","contentSchema","default","const","examples"] */ qualifierMessagesOrder: CheckKey[] + /** + * Defines how deep the schema should be expanded by default + * Examples: + * - 0: only the root level is expanded + * - 1: root level and its direct children are expanded + * - Infinity: expand all levels + * @default 0 + * @min 0 + */ + defaultExpandDepth: number } // Define an InjectionToken for JSVOptions @@ -72,7 +82,8 @@ export class JSVOptionsService { "default", "const", "examples" - ] + ], + defaultExpandDepth: 0 } // Apply user provided options this.setOptions(userOptions); @@ -89,4 +100,4 @@ export class JSVOptionsService { return this.options; } -} \ No newline at end of file +}