Skip to content

Commit 6c8c8a5

Browse files
committed
refactor(config): replace JsonSchema type with flexible toJSON-based validationSchema definition
1 parent 0c87b16 commit 6c8c8a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/config/src/interfaces/ConfigSource.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type {Type} from "@tsed/core";
2-
import {JsonSchema} from "@tsed/schema";
32

43
export interface ConfigSourceOptions<Opts = any> {
54
/**
@@ -28,9 +27,9 @@ export interface ConfigSourceOptions<Opts = any> {
2827
*/
2928
options: Opts;
3029
/**
31-
* The schema to validate the configuration values against.
30+
* A JsonSchema instance to validate the configuration values against.
3231
*/
33-
validationSchema?: JsonSchema;
32+
validationSchema?: {toJSON(opts: Record<string, unknown>): Record<string, unknown> & {required?: string[]}};
3433
/**
3534
* Enable FileSystem Watch mode. ConfigSource must implement the `watch()` method.
3635
*/
@@ -55,7 +54,9 @@ export interface ConfigSource<Opts = any> {
5554
options: Opts;
5655

5756
$onInit?(): Promise<void> | void;
57+
5858
$onDestroy?(): Promise<void> | void;
59+
5960
/**
6061
* Load configuration from the source.
6162
*/

0 commit comments

Comments
 (0)