@@ -43,6 +43,10 @@ describe("types", () => {
43
43
} ,
44
44
string : { type : "string" } ,
45
45
string_ref : { $ref : "#/components/schemas/string" } ,
46
+ nullable : {
47
+ type : "string" ,
48
+ nullable : true ,
49
+ } ,
46
50
} ,
47
51
} ,
48
52
} ;
@@ -53,6 +57,7 @@ describe("types", () => {
53
57
object: { string?: string };
54
58
string: string;
55
59
string_ref: components['schemas']['string'];
60
+ nullable: string | null;
56
61
}
57
62
}` )
58
63
) ;
@@ -72,6 +77,10 @@ describe("types", () => {
72
77
} ,
73
78
number : { type : "number" } ,
74
79
number_ref : { $ref : "#/components/schemas/number" } ,
80
+ nullable : {
81
+ type : "number" ,
82
+ nullable : true ,
83
+ } ,
75
84
} ,
76
85
} ,
77
86
} ;
@@ -82,6 +91,7 @@ describe("types", () => {
82
91
object: { integer?: number; number?: number }
83
92
number: number;
84
93
number_ref: components['schemas']['number'];
94
+ nullable: number | null;
85
95
}
86
96
}` )
87
97
) ;
@@ -98,6 +108,7 @@ describe("types", () => {
98
108
} ,
99
109
boolean : { type : "boolean" } ,
100
110
boolean_ref : { $ref : "#/components/schemas/boolean" } ,
111
+ nullable : { type : "boolean" , nullable : true } ,
101
112
} ,
102
113
} ,
103
114
} ;
@@ -108,6 +119,7 @@ describe("types", () => {
108
119
object: { boolean?: boolean };
109
120
boolean: boolean;
110
121
boolean_ref: components['schemas']['boolean'];
122
+ nullable: boolean | null;
111
123
}
112
124
}` )
113
125
) ;
@@ -141,6 +153,13 @@ describe("types", () => {
141
153
} ,
142
154
object_unknown : { type : "object" } ,
143
155
object_empty : { } ,
156
+ nullable : {
157
+ type : "object" ,
158
+ properties : {
159
+ string : { type : "string" } ,
160
+ } ,
161
+ nullable : true ,
162
+ } ,
144
163
} ,
145
164
} ,
146
165
} ;
@@ -156,6 +175,7 @@ describe("types", () => {
156
175
object_ref: { number?: number };
157
176
object_unknown: { [key: string]: any };
158
177
object_empty: { [key: string]: any };
178
+ nullable: { string?: string } | null;
159
179
}
160
180
}` )
161
181
) ;
@@ -181,14 +201,20 @@ describe("types", () => {
181
201
} ,
182
202
type : "object" ,
183
203
} ,
184
- inferred_array : {
185
- items : { $ref : "#/components/schemas/array" } ,
186
- } ,
204
+
187
205
string : { type : "string" } ,
188
206
array_ref : {
189
207
items : { $ref : "#/components/schemas/array" } ,
190
208
type : "array" ,
191
209
} ,
210
+ inferred_array : {
211
+ items : { $ref : "#/components/schemas/array" } ,
212
+ } ,
213
+ nullable : {
214
+ type : "array" ,
215
+ items : { type : "string" } ,
216
+ nullable : true ,
217
+ } ,
192
218
} ,
193
219
} ,
194
220
} ;
@@ -203,9 +229,10 @@ describe("types", () => {
203
229
numbers?: number[];
204
230
refs?: components['schemas']['string'][];
205
231
};
206
- inferred_array: components['schemas']['array'][];
207
232
string: string;
208
233
array_ref: components['schemas']['array'][];
234
+ inferred_array: components['schemas']['array'][];
235
+ nullable: string[] | null;
209
236
}
210
237
}` )
211
238
) ;
0 commit comments