Skip to content

Commit ab5cbc6

Browse files
committed
chore: add undefined to all optional properties
1 parent 54d366e commit ab5cbc6

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

src/2020-12.ts

+54-54
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,95 @@
11
export const dialectIdentifier = 'https://json-schema.org/draft/2020-12/schema';
22

33
type CoreKeywords = {
4-
$anchor?: string;
5-
$comment?: string;
6-
$defs?: { [key: string]: JsonSchema };
7-
$dynamicAnchor?: string;
8-
$dynamicRef?: string;
9-
$id?: string;
10-
$ref?: string;
11-
$schema?: typeof dialectIdentifier;
12-
$vocabulary?: { [uri: string]: boolean };
4+
$anchor?: undefined | string;
5+
$comment?: undefined | string;
6+
$defs?: undefined | { [key: string]: JsonSchema };
7+
$dynamicAnchor?: undefined | string;
8+
$dynamicRef?: undefined | string;
9+
$id?: undefined | string;
10+
$ref?: undefined | string;
11+
$schema?: undefined | typeof dialectIdentifier;
12+
$vocabulary?: undefined | { [uri: string]: boolean };
1313
};
1414

1515
type LogicSubschemasKeywords = {
16-
allOf?: Array<JsonSchema>;
17-
anyOf?: Array<JsonSchema>;
18-
not?: JsonSchema;
19-
oneOf?: Array<JsonSchema>;
16+
allOf?: undefined | Array<JsonSchema>;
17+
anyOf?: undefined | Array<JsonSchema>;
18+
not?: undefined | JsonSchema;
19+
oneOf?: undefined | Array<JsonSchema>;
2020
};
2121

2222
type ConditionalSubschemasKeywords = {
23-
dependentSchemas?: { [key: string]: JsonSchema };
24-
else?: JsonSchema;
25-
if?: JsonSchema;
26-
then?: JsonSchema;
23+
dependentSchemas?: undefined | { [key: string]: JsonSchema };
24+
else?: undefined | JsonSchema;
25+
if?: undefined | JsonSchema;
26+
then?: undefined | JsonSchema;
2727
};
2828

2929
type MetaDataAnnotationKeywords = {
30-
default?: any;
31-
deprecated?: boolean;
32-
description?: string;
33-
examples?: Array<any>;
34-
readOnly?: boolean;
35-
title?: string;
36-
writeOnly?: boolean;
30+
default?: undefined | any;
31+
deprecated?: undefined | boolean;
32+
description?: undefined | string;
33+
examples?: undefined | Array<any>;
34+
readOnly?: undefined | boolean;
35+
title?: undefined | string;
36+
writeOnly?: undefined | boolean;
3737
};
3838

3939
type FormatKeywords = {
40-
format?: string;
40+
format?: undefined | string;
4141
};
4242

4343
type JsonSchemaType = 'null' | 'boolean' | 'string' | 'integer' | 'number' | 'array' | 'object';
4444

4545
type CommonValidationKeywords = {
46-
const?: any;
47-
enum?: Array<any>;
48-
type?: JsonSchemaType | Array<JsonSchemaType>;
46+
const?: undefined | any;
47+
enum?: undefined | Array<any>;
48+
type?: undefined | JsonSchemaType | Array<JsonSchemaType>;
4949
};
5050

5151
type StringValidationKeywords = {
52-
maxLength?: number;
53-
minLength?: number;
54-
pattern?: string;
52+
maxLength?: undefined | number;
53+
minLength?: undefined | number;
54+
pattern?: undefined | string;
5555
};
5656

5757
type NumericValidationKeywords = {
58-
exclusiveMaximum?: number;
59-
exclusiveMinimum?: number;
60-
maximum?: number;
61-
minimum?: number;
62-
multipleOf?: number;
58+
exclusiveMaximum?: undefined | number;
59+
exclusiveMinimum?: undefined | number;
60+
maximum?: undefined | number;
61+
minimum?: undefined | number;
62+
multipleOf?: undefined | number;
6363
};
6464

6565
type ArrayValidationKeywords = {
66-
contains?: JsonSchema;
67-
items?: JsonSchema;
68-
maxContains?: number;
69-
maxItems?: number;
70-
minContains?: number;
71-
minItems?: number;
72-
prefixItems?: Array<JsonSchema>;
73-
uniqueItems?: boolean;
66+
contains?: undefined | JsonSchema;
67+
items?: undefined | JsonSchema;
68+
maxContains?: undefined | number;
69+
maxItems?: undefined | number;
70+
minContains?: undefined | number;
71+
minItems?: undefined | number;
72+
prefixItems?: undefined | Array<JsonSchema>;
73+
uniqueItems?: undefined | boolean;
7474
};
7575

7676
type ObjectValidationKeywords = {
77-
dependentRequired?: Record<string, Array<string>>;
78-
maxProperties?: number;
79-
minProperties?: number;
80-
required?: string[];
77+
dependentRequired?: undefined | Record<string, Array<string>>;
78+
maxProperties?: undefined | number;
79+
minProperties?: undefined | number;
80+
required?: undefined | string[];
8181
};
8282

8383
type ObjectSubschemaKeywords = {
84-
additionalProperties?: JsonSchema;
85-
patternProperties?: { [propertyNameRegex: string]: JsonSchema };
86-
properties?: { [propertyName: string]: JsonSchema };
87-
propertyNames?: JsonSchema;
84+
additionalProperties?: undefined | JsonSchema;
85+
patternProperties?: undefined | { [propertyNameRegex: string]: JsonSchema };
86+
properties?: undefined | { [propertyName: string]: JsonSchema };
87+
propertyNames?: undefined | JsonSchema;
8888
};
8989

9090
type UnevaluatedLocationsKeywords = {
91-
unevaluatedItems?: JsonSchema;
92-
unevaluatedProperties?: JsonSchema;
91+
unevaluatedItems?: undefined | JsonSchema;
92+
unevaluatedProperties?: undefined | JsonSchema;
9393
};
9494

9595
export type JsonSchemaObject = CoreKeywords &

0 commit comments

Comments
 (0)