-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathfromSchemaOptions.ts
40 lines (36 loc) · 1.08 KB
/
fromSchemaOptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { JSONSchemaReference } from "~/definitions";
import type { DeserializationPattern } from "./deserializationPattern";
import type {
ExtendedJSONSchemaReference,
JSONSchemaExtension,
} from "./extendedJsonSchema";
/**
* FromSchema options constraints
*/
export type FromSchemaOptions = {
parseNotKeyword?: boolean;
parseIfThenElseKeywords?: boolean;
keepDefaultedPropertiesOptional?: boolean;
references?: JSONSchemaReference[] | false;
deserialize?: DeserializationPattern[] | false;
};
/**
* FromExtendedSchema options constraints
*/
export type FromExtendedSchemaOptions<EXTENSION extends JSONSchemaExtension> = {
parseNotKeyword?: boolean;
parseIfThenElseKeywords?: boolean;
keepDefaultedPropertiesOptional?: boolean;
references?: ExtendedJSONSchemaReference<EXTENSION>[] | false;
deserialize?: DeserializationPattern[] | false;
};
/**
* FromSchema default options
*/
export type FromSchemaDefaultOptions = {
parseNotKeyword: false;
parseIfThenElseKeywords: false;
keepDefaultedPropertiesOptional: false;
references: false;
deserialize: false;
};