Skip to content

Commit 671e670

Browse files
committed
Add format keyword
1 parent 6b3e6d9 commit 671e670

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/2020-12.ts

+14-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ type ConditionalSubschemasKeywords = {
2424
then?: JsonSchema;
2525
};
2626

27-
type JsonSchemaType = 'null' | 'boolean' | 'string' | 'integer' | 'number' | 'array' | 'object';
28-
29-
type AnyValidationKeywords = {
30-
const?: any;
31-
enum?: Array<any>;
32-
type?: JsonSchemaType | Array<JsonSchemaType>;
33-
};
34-
3527
type MetaDataAnnotationKeywords = {
3628
default?: any;
3729
deprecated?: boolean;
@@ -42,6 +34,18 @@ type MetaDataAnnotationKeywords = {
4234
writeOnly?: boolean;
4335
};
4436

37+
type FormatKeywords = {
38+
format?: string;
39+
};
40+
41+
type JsonSchemaType = 'null' | 'boolean' | 'string' | 'integer' | 'number' | 'array' | 'object';
42+
43+
type CommonValidationKeywords = {
44+
const?: any;
45+
enum?: Array<any>;
46+
type?: JsonSchemaType | Array<JsonSchemaType>;
47+
};
48+
4549
type StringValidationKeywords = {
4650
maxLength?: number;
4751
minLength?: number;
@@ -90,8 +94,9 @@ export type JsonSchema = CoreKeywords &
9094
LogicSubschemasKeywords &
9195
ConditionalSubschemasKeywords &
9296
JsonSchemaType &
93-
AnyValidationKeywords &
97+
CommonValidationKeywords &
9498
MetaDataAnnotationKeywords &
99+
FormatKeywords &
95100
StringValidationKeywords &
96101
NumericValidationKeywords &
97102
ArrayValidationKeywords &

0 commit comments

Comments
 (0)