@trayio/tray-openapi 4.10.0 → 4.11.1-unstable
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OpenApiTypeDescriptors.d.ts +1 -0
- package/dist/OpenApiTypeDescriptors.d.ts.map +1 -1
- package/dist/OpenApiTypeDescriptors.js +1 -0
- package/dist/file-generators/GenerateHandler.d.ts.map +1 -1
- package/dist/file-generators/GenerateHandler.js +20 -3
- package/dist/file-generators/GenerateHandler.test.js +21 -0
- package/dist/file-generators/GenerateHandlerTest.test.js +33 -0
- package/dist/file-generators/types/GenerateInputSchema.d.ts.map +1 -1
- package/dist/file-generators/types/GenerateInputSchema.js +3 -0
- package/dist/file-generators/types/GenerateInputSchema.test.js +9 -0
- package/dist/file-generators/types/GenerateInputType.test.js +22 -0
- package/dist/file-generators/types/GenerateOutput.d.ts.map +1 -1
- package/dist/file-generators/types/GenerateOutput.js +1 -0
- package/dist/file-generators/types/GenerateOutput.test.js +10 -0
- package/dist/file-generators/types/JsonSchemaToTypescriptOptions.d.ts +1 -0
- package/dist/file-generators/types/JsonSchemaToTypescriptOptions.d.ts.map +1 -1
- package/dist/file-generators/types/JsonSchemaToTypescriptOptions.js +1 -0
- package/package.json +1 -1
|
@@ -100,6 +100,7 @@ export type BaseSchemaObject = {
|
|
|
100
100
|
anyOf: O.Option<SchemaObject[]>;
|
|
101
101
|
not: O.Option<SchemaObject>;
|
|
102
102
|
in: O.Option<string>;
|
|
103
|
+
nullable: O.Option<boolean>;
|
|
103
104
|
default: O.Option<string | number | boolean | Array<string | number | boolean>>;
|
|
104
105
|
};
|
|
105
106
|
export declare const baseSchemaObjectSchemaTypeDescriptor: t.Type<BaseSchemaObject, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiTypeDescriptors.d.ts","sourceRoot":"","sources":["../src/OpenApiTypeDescriptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM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O,MAAM,qBAAqB,wDAEjC,CAAC;AAuBF,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAQpE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAQ9D,CAAC;AAUH,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAWpE,CAAC"}
|
|
@@ -45,6 +45,7 @@ exports.baseSchemaObjectSchemaTypeDescriptor = t.recursion('baseSchema', () => t
|
|
|
45
45
|
anyOf: (0, io_ts_types_1.optionFromNullable)(t.array(exports.schemaObjectTypeDescriptor)),
|
|
46
46
|
not: (0, io_ts_types_1.optionFromNullable)(exports.schemaObjectTypeDescriptor),
|
|
47
47
|
in: (0, io_ts_types_1.optionFromNullable)(t.string),
|
|
48
|
+
nullable: (0, io_ts_types_1.optionFromNullable)(t.boolean),
|
|
48
49
|
default: (0, io_ts_types_1.optionFromNullable)(t.union([
|
|
49
50
|
t.string,
|
|
50
51
|
t.number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateHandler.d.ts","sourceRoot":"","sources":["../../src/file-generators/GenerateHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAoB,MAAM,2BAA2B,CAAC;AAE3E,KAAK,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG;IAClC,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"GenerateHandler.d.ts","sourceRoot":"","sources":["../../src/file-generators/GenerateHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAoB,MAAM,2BAA2B,CAAC;AAE3E,KAAK,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,MAAM,oBAAoB,GAAG;IAClC,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;CACpB,CAAC;AAsKF,eAAO,MAAM,eAAe,wHAQzB,oBAAoB,KAAG,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAqB9C,CAAC"}
|
|
@@ -38,7 +38,20 @@ const getInputVariable = (name, type) => O.fold(() => `input.${name}`, (inputTyp
|
|
|
38
38
|
})(type);
|
|
39
39
|
const generateRequestHandlerInputs = (inputs, bodyInputs) => {
|
|
40
40
|
if (bodyInputs.length > 0) {
|
|
41
|
-
|
|
41
|
+
let containsNullable = false;
|
|
42
|
+
const bodyInputProperties = bodyInputs.map(({ input, nullable }) => {
|
|
43
|
+
if (nullable) {
|
|
44
|
+
containsNullable = true;
|
|
45
|
+
}
|
|
46
|
+
return input;
|
|
47
|
+
});
|
|
48
|
+
let constructedBodyProperty = `return requestBuilder.withBodyAsJson(`;
|
|
49
|
+
if (containsNullable) {
|
|
50
|
+
constructedBodyProperty = `return requestBuilder.withBodyAsJson(castUndefinedPropertyToNull({ ${bodyInputProperties.join(',')} }))`;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
constructedBodyProperty = `return requestBuilder.withBodyAsJson({ ${bodyInputProperties.join(',')} })`;
|
|
54
|
+
}
|
|
42
55
|
if (inputs[0] === 'requestBuilder.') {
|
|
43
56
|
const cleanInput = inputs.filter((item) => item !== '');
|
|
44
57
|
return cleanInput
|
|
@@ -68,7 +81,10 @@ const constructInputs = (properties, requiredInputs) => {
|
|
|
68
81
|
return O.fold(() => '', (inputIn) => {
|
|
69
82
|
switch (inputIn) {
|
|
70
83
|
case 'body':
|
|
71
|
-
bodyInputs.push(
|
|
84
|
+
bodyInputs.push({
|
|
85
|
+
input: `${name}: input.${name}`,
|
|
86
|
+
nullable: O.getOrElse(() => false)(input.nullable),
|
|
87
|
+
});
|
|
72
88
|
break;
|
|
73
89
|
case 'path':
|
|
74
90
|
inputMapping = handleOptionalInput(`requestBuilder = requestBuilder.addPathParameter("${name}", ${getInputVariable(name, input.type)});`, name, requiredInputsArray);
|
|
@@ -93,7 +109,8 @@ const generatePath = (path, inputs) => O.fold(() => path, (properties) => Object
|
|
|
93
109
|
return acc;
|
|
94
110
|
})(input.in), path))(inputs.properties);
|
|
95
111
|
const generateHandler = ({ connectorNamePascalCase, operationNamePascalCase, operationNameCamelCase, httpMethod, baseUrl, httpPath, input, }) => E.tryCatch(() => `import { OperationHandlerSetup } from "@trayio/cdk-dsl/connector/operation/OperationHandlerSetup";
|
|
96
|
-
import {
|
|
112
|
+
import { castUndefinedPropertyToNull } from '@trayio/commons/dynamictype/DynamicType';
|
|
113
|
+
import { ${connectorNamePascalCase}Auth } from "../${connectorNamePascalCase}Auth";
|
|
97
114
|
import { ${operationNamePascalCase}Input } from "./input";
|
|
98
115
|
import { ${operationNamePascalCase}Output } from "./output";
|
|
99
116
|
|
|
@@ -44,6 +44,7 @@ const getGenerateHandlerInput = (input) => ({
|
|
|
44
44
|
in: O.none,
|
|
45
45
|
type: O.none,
|
|
46
46
|
default: O.none,
|
|
47
|
+
nullable: O.none,
|
|
47
48
|
},
|
|
48
49
|
httpPath: '/photos',
|
|
49
50
|
...input,
|
|
@@ -87,6 +88,7 @@ describe('GenerateHandler', () => {
|
|
|
87
88
|
anyOf: O.none,
|
|
88
89
|
not: O.none,
|
|
89
90
|
default: O.none,
|
|
91
|
+
nullable: O.none,
|
|
90
92
|
},
|
|
91
93
|
}),
|
|
92
94
|
required: O.some(['photoId']),
|
|
@@ -97,6 +99,7 @@ describe('GenerateHandler', () => {
|
|
|
97
99
|
not: O.none,
|
|
98
100
|
in: O.none,
|
|
99
101
|
default: O.none,
|
|
102
|
+
nullable: O.none,
|
|
100
103
|
};
|
|
101
104
|
const payload = getGenerateHandlerInput({
|
|
102
105
|
input,
|
|
@@ -138,6 +141,7 @@ describe('GenerateHandler', () => {
|
|
|
138
141
|
anyOf: O.none,
|
|
139
142
|
not: O.none,
|
|
140
143
|
default: O.none,
|
|
144
|
+
nullable: O.none,
|
|
141
145
|
},
|
|
142
146
|
}),
|
|
143
147
|
required: O.some(['photoId']),
|
|
@@ -148,6 +152,7 @@ describe('GenerateHandler', () => {
|
|
|
148
152
|
not: O.none,
|
|
149
153
|
in: O.none,
|
|
150
154
|
default: O.none,
|
|
155
|
+
nullable: O.none,
|
|
151
156
|
};
|
|
152
157
|
const payload = getGenerateHandlerInput({ input });
|
|
153
158
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -186,6 +191,7 @@ describe('GenerateHandler', () => {
|
|
|
186
191
|
anyOf: O.none,
|
|
187
192
|
not: O.none,
|
|
188
193
|
default: O.none,
|
|
194
|
+
nullable: O.none,
|
|
189
195
|
},
|
|
190
196
|
}),
|
|
191
197
|
required: O.some(['id']),
|
|
@@ -196,6 +202,7 @@ describe('GenerateHandler', () => {
|
|
|
196
202
|
not: O.none,
|
|
197
203
|
in: O.none,
|
|
198
204
|
default: O.none,
|
|
205
|
+
nullable: O.none,
|
|
199
206
|
};
|
|
200
207
|
const payload = getGenerateHandlerInput({ input });
|
|
201
208
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -234,6 +241,7 @@ describe('GenerateHandler', () => {
|
|
|
234
241
|
anyOf: O.none,
|
|
235
242
|
not: O.none,
|
|
236
243
|
default: O.none,
|
|
244
|
+
nullable: O.none,
|
|
237
245
|
},
|
|
238
246
|
}),
|
|
239
247
|
required: O.some(['Content-Type']),
|
|
@@ -244,6 +252,7 @@ describe('GenerateHandler', () => {
|
|
|
244
252
|
not: O.none,
|
|
245
253
|
in: O.none,
|
|
246
254
|
default: O.none,
|
|
255
|
+
nullable: O.none,
|
|
247
256
|
};
|
|
248
257
|
const payload = getGenerateHandlerInput({ input });
|
|
249
258
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -282,6 +291,7 @@ describe('GenerateHandler', () => {
|
|
|
282
291
|
anyOf: O.none,
|
|
283
292
|
not: O.none,
|
|
284
293
|
default: O.none,
|
|
294
|
+
nullable: O.none,
|
|
285
295
|
},
|
|
286
296
|
}),
|
|
287
297
|
required: O.none,
|
|
@@ -292,6 +302,7 @@ describe('GenerateHandler', () => {
|
|
|
292
302
|
not: O.none,
|
|
293
303
|
in: O.none,
|
|
294
304
|
default: O.none,
|
|
305
|
+
nullable: O.none,
|
|
295
306
|
};
|
|
296
307
|
const payload = getGenerateHandlerInput({ input });
|
|
297
308
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -330,6 +341,7 @@ describe('GenerateHandler', () => {
|
|
|
330
341
|
anyOf: O.none,
|
|
331
342
|
not: O.none,
|
|
332
343
|
default: O.none,
|
|
344
|
+
nullable: O.none,
|
|
333
345
|
},
|
|
334
346
|
photoId: {
|
|
335
347
|
title: O.none,
|
|
@@ -343,6 +355,7 @@ describe('GenerateHandler', () => {
|
|
|
343
355
|
anyOf: O.none,
|
|
344
356
|
not: O.none,
|
|
345
357
|
default: O.none,
|
|
358
|
+
nullable: O.none,
|
|
346
359
|
},
|
|
347
360
|
commentId: {
|
|
348
361
|
title: O.none,
|
|
@@ -356,6 +369,7 @@ describe('GenerateHandler', () => {
|
|
|
356
369
|
anyOf: O.none,
|
|
357
370
|
not: O.none,
|
|
358
371
|
default: O.none,
|
|
372
|
+
nullable: O.none,
|
|
359
373
|
},
|
|
360
374
|
}),
|
|
361
375
|
required: O.some(['photoId']),
|
|
@@ -366,6 +380,7 @@ describe('GenerateHandler', () => {
|
|
|
366
380
|
not: O.none,
|
|
367
381
|
in: O.none,
|
|
368
382
|
default: O.none,
|
|
383
|
+
nullable: O.none,
|
|
369
384
|
};
|
|
370
385
|
const payload = getGenerateHandlerInput({
|
|
371
386
|
input,
|
|
@@ -407,6 +422,7 @@ describe('GenerateHandler', () => {
|
|
|
407
422
|
anyOf: O.none,
|
|
408
423
|
not: O.none,
|
|
409
424
|
default: O.none,
|
|
425
|
+
nullable: O.none,
|
|
410
426
|
},
|
|
411
427
|
photoId: {
|
|
412
428
|
title: O.none,
|
|
@@ -420,6 +436,7 @@ describe('GenerateHandler', () => {
|
|
|
420
436
|
anyOf: O.none,
|
|
421
437
|
not: O.none,
|
|
422
438
|
default: O.none,
|
|
439
|
+
nullable: O.none,
|
|
423
440
|
},
|
|
424
441
|
}),
|
|
425
442
|
required: O.some(['id', 'photoId']),
|
|
@@ -430,6 +447,7 @@ describe('GenerateHandler', () => {
|
|
|
430
447
|
not: O.none,
|
|
431
448
|
in: O.none,
|
|
432
449
|
default: O.none,
|
|
450
|
+
nullable: O.none,
|
|
433
451
|
};
|
|
434
452
|
const payload = getGenerateHandlerInput({ input });
|
|
435
453
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -468,6 +486,7 @@ describe('GenerateHandler', () => {
|
|
|
468
486
|
anyOf: O.none,
|
|
469
487
|
not: O.none,
|
|
470
488
|
default: O.none,
|
|
489
|
+
nullable: O.none,
|
|
471
490
|
},
|
|
472
491
|
photoId: {
|
|
473
492
|
title: O.none,
|
|
@@ -481,6 +500,7 @@ describe('GenerateHandler', () => {
|
|
|
481
500
|
anyOf: O.none,
|
|
482
501
|
not: O.none,
|
|
483
502
|
default: O.none,
|
|
503
|
+
nullable: O.none,
|
|
484
504
|
},
|
|
485
505
|
}),
|
|
486
506
|
required: O.some(['photoId']),
|
|
@@ -491,6 +511,7 @@ describe('GenerateHandler', () => {
|
|
|
491
511
|
not: O.none,
|
|
492
512
|
in: O.none,
|
|
493
513
|
default: O.none,
|
|
514
|
+
nullable: O.none,
|
|
494
515
|
};
|
|
495
516
|
const payload = getGenerateHandlerInput({ input });
|
|
496
517
|
const generatedHandler = (0, GenerateHandler_1.generateHandler)(payload);
|
|
@@ -47,6 +47,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
47
47
|
not: O.none,
|
|
48
48
|
in: O.none,
|
|
49
49
|
default: O.none,
|
|
50
|
+
nullable: O.none,
|
|
50
51
|
},
|
|
51
52
|
name: {
|
|
52
53
|
title: O.none,
|
|
@@ -60,6 +61,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
60
61
|
not: O.none,
|
|
61
62
|
in: O.none,
|
|
62
63
|
default: O.none,
|
|
64
|
+
nullable: O.none,
|
|
63
65
|
},
|
|
64
66
|
}),
|
|
65
67
|
required: O.some(['id', 'name']),
|
|
@@ -70,6 +72,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
70
72
|
not: O.none,
|
|
71
73
|
in: O.none,
|
|
72
74
|
default: O.none,
|
|
75
|
+
nullable: O.none,
|
|
73
76
|
},
|
|
74
77
|
output: {
|
|
75
78
|
type: O.some('object'),
|
|
@@ -88,6 +91,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
88
91
|
not: O.none,
|
|
89
92
|
in: O.none,
|
|
90
93
|
default: O.none,
|
|
94
|
+
nullable: O.none,
|
|
91
95
|
},
|
|
92
96
|
name: {
|
|
93
97
|
title: O.none,
|
|
@@ -101,6 +105,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
101
105
|
not: O.none,
|
|
102
106
|
in: O.none,
|
|
103
107
|
default: O.none,
|
|
108
|
+
nullable: O.none,
|
|
104
109
|
},
|
|
105
110
|
}),
|
|
106
111
|
required: O.some(['id']),
|
|
@@ -111,6 +116,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
111
116
|
not: O.none,
|
|
112
117
|
in: O.none,
|
|
113
118
|
default: O.none,
|
|
119
|
+
nullable: O.none,
|
|
114
120
|
},
|
|
115
121
|
};
|
|
116
122
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -158,6 +164,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
158
164
|
not: O.none,
|
|
159
165
|
in: O.none,
|
|
160
166
|
default: O.none,
|
|
167
|
+
nullable: O.none,
|
|
161
168
|
},
|
|
162
169
|
output: {
|
|
163
170
|
type: O.some('object'),
|
|
@@ -175,6 +182,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
175
182
|
not: O.none,
|
|
176
183
|
in: O.none,
|
|
177
184
|
default: O.none,
|
|
185
|
+
nullable: O.none,
|
|
178
186
|
},
|
|
179
187
|
}),
|
|
180
188
|
required: O.some(['success']),
|
|
@@ -185,6 +193,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
185
193
|
not: O.none,
|
|
186
194
|
in: O.none,
|
|
187
195
|
default: O.none,
|
|
196
|
+
nullable: O.none,
|
|
188
197
|
},
|
|
189
198
|
};
|
|
190
199
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -239,6 +248,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
239
248
|
not: O.none,
|
|
240
249
|
in: O.none,
|
|
241
250
|
default: O.none,
|
|
251
|
+
nullable: O.none,
|
|
242
252
|
},
|
|
243
253
|
age: {
|
|
244
254
|
title: O.none,
|
|
@@ -252,6 +262,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
252
262
|
not: O.none,
|
|
253
263
|
in: O.none,
|
|
254
264
|
default: O.none,
|
|
265
|
+
nullable: O.none,
|
|
255
266
|
},
|
|
256
267
|
}),
|
|
257
268
|
required: O.none,
|
|
@@ -262,6 +273,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
262
273
|
not: O.none,
|
|
263
274
|
in: O.none,
|
|
264
275
|
default: O.none,
|
|
276
|
+
nullable: O.none,
|
|
265
277
|
},
|
|
266
278
|
}),
|
|
267
279
|
required: O.none,
|
|
@@ -272,6 +284,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
272
284
|
not: O.none,
|
|
273
285
|
in: O.none,
|
|
274
286
|
default: O.none,
|
|
287
|
+
nullable: O.none,
|
|
275
288
|
},
|
|
276
289
|
output: {
|
|
277
290
|
title: O.none,
|
|
@@ -293,6 +306,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
293
306
|
not: O.none,
|
|
294
307
|
in: O.none,
|
|
295
308
|
default: O.none,
|
|
309
|
+
nullable: O.none,
|
|
296
310
|
},
|
|
297
311
|
}),
|
|
298
312
|
required: O.none,
|
|
@@ -303,6 +317,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
303
317
|
not: O.none,
|
|
304
318
|
in: O.none,
|
|
305
319
|
default: O.none,
|
|
320
|
+
nullable: O.none,
|
|
306
321
|
},
|
|
307
322
|
}),
|
|
308
323
|
required: O.none,
|
|
@@ -313,6 +328,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
313
328
|
not: O.none,
|
|
314
329
|
in: O.none,
|
|
315
330
|
default: O.none,
|
|
331
|
+
nullable: O.none,
|
|
316
332
|
},
|
|
317
333
|
};
|
|
318
334
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -366,6 +382,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
366
382
|
not: O.none,
|
|
367
383
|
in: O.none,
|
|
368
384
|
default: O.none,
|
|
385
|
+
nullable: O.none,
|
|
369
386
|
},
|
|
370
387
|
properties: O.none,
|
|
371
388
|
required: O.none,
|
|
@@ -376,6 +393,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
376
393
|
not: O.none,
|
|
377
394
|
in: O.none,
|
|
378
395
|
default: O.none,
|
|
396
|
+
nullable: O.none,
|
|
379
397
|
},
|
|
380
398
|
}),
|
|
381
399
|
required: O.none,
|
|
@@ -386,6 +404,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
386
404
|
not: O.none,
|
|
387
405
|
in: O.none,
|
|
388
406
|
default: O.none,
|
|
407
|
+
nullable: O.none,
|
|
389
408
|
},
|
|
390
409
|
output: {
|
|
391
410
|
type: O.some('object'),
|
|
@@ -406,6 +425,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
406
425
|
not: O.none,
|
|
407
426
|
in: O.none,
|
|
408
427
|
default: O.none,
|
|
428
|
+
nullable: O.none,
|
|
409
429
|
},
|
|
410
430
|
properties: O.none,
|
|
411
431
|
required: O.none,
|
|
@@ -416,6 +436,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
416
436
|
not: O.none,
|
|
417
437
|
in: O.none,
|
|
418
438
|
default: O.none,
|
|
439
|
+
nullable: O.none,
|
|
419
440
|
},
|
|
420
441
|
}),
|
|
421
442
|
required: O.none,
|
|
@@ -426,6 +447,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
426
447
|
not: O.none,
|
|
427
448
|
in: O.none,
|
|
428
449
|
default: O.none,
|
|
450
|
+
nullable: O.none,
|
|
429
451
|
},
|
|
430
452
|
};
|
|
431
453
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -472,6 +494,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
472
494
|
not: O.none,
|
|
473
495
|
in: O.none,
|
|
474
496
|
default: O.none,
|
|
497
|
+
nullable: O.none,
|
|
475
498
|
},
|
|
476
499
|
output: {
|
|
477
500
|
type: O.some('object'),
|
|
@@ -493,6 +516,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
493
516
|
not: O.none,
|
|
494
517
|
in: O.none,
|
|
495
518
|
default: O.none,
|
|
519
|
+
nullable: O.none,
|
|
496
520
|
},
|
|
497
521
|
valueList: {
|
|
498
522
|
title: O.none,
|
|
@@ -509,6 +533,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
509
533
|
not: O.none,
|
|
510
534
|
in: O.none,
|
|
511
535
|
default: O.none,
|
|
536
|
+
nullable: O.none,
|
|
512
537
|
},
|
|
513
538
|
properties: O.none,
|
|
514
539
|
required: O.none,
|
|
@@ -519,6 +544,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
519
544
|
not: O.none,
|
|
520
545
|
in: O.none,
|
|
521
546
|
default: O.none,
|
|
547
|
+
nullable: O.none,
|
|
522
548
|
},
|
|
523
549
|
}),
|
|
524
550
|
required: O.none,
|
|
@@ -529,6 +555,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
529
555
|
not: O.none,
|
|
530
556
|
in: O.none,
|
|
531
557
|
default: O.none,
|
|
558
|
+
nullable: O.none,
|
|
532
559
|
},
|
|
533
560
|
}),
|
|
534
561
|
required: O.none,
|
|
@@ -539,6 +566,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
539
566
|
not: O.none,
|
|
540
567
|
in: O.none,
|
|
541
568
|
default: O.none,
|
|
569
|
+
nullable: O.none,
|
|
542
570
|
},
|
|
543
571
|
};
|
|
544
572
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -585,6 +613,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
585
613
|
not: O.none,
|
|
586
614
|
in: O.none,
|
|
587
615
|
default: O.none,
|
|
616
|
+
nullable: O.none,
|
|
588
617
|
},
|
|
589
618
|
output: {
|
|
590
619
|
title: O.none,
|
|
@@ -609,6 +638,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
609
638
|
not: O.none,
|
|
610
639
|
in: O.none,
|
|
611
640
|
default: O.none,
|
|
641
|
+
nullable: O.none,
|
|
612
642
|
},
|
|
613
643
|
}),
|
|
614
644
|
required: O.none,
|
|
@@ -619,6 +649,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
619
649
|
not: O.none,
|
|
620
650
|
in: O.none,
|
|
621
651
|
default: O.none,
|
|
652
|
+
nullable: O.none,
|
|
622
653
|
},
|
|
623
654
|
properties: O.none,
|
|
624
655
|
required: O.none,
|
|
@@ -629,6 +660,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
629
660
|
not: O.none,
|
|
630
661
|
in: O.none,
|
|
631
662
|
default: O.none,
|
|
663
|
+
nullable: O.none,
|
|
632
664
|
},
|
|
633
665
|
}),
|
|
634
666
|
required: O.none,
|
|
@@ -639,6 +671,7 @@ describe('GenerateHandlerTest', () => {
|
|
|
639
671
|
not: O.none,
|
|
640
672
|
in: O.none,
|
|
641
673
|
default: O.none,
|
|
674
|
+
nullable: O.none,
|
|
642
675
|
},
|
|
643
676
|
};
|
|
644
677
|
const result = (0, GenerateHandlerTest_1.generateHandlerTest)(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateInputSchema.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/GenerateInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAQlC,OAAO,EACN,IAAI,EAGJ,YAAY,EAEZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"GenerateInputSchema.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/GenerateInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAQlC,OAAO,EACN,IAAI,EAGJ,YAAY,EAEZ,MAAM,8BAA8B,CAAC;AAkJtC,eAAO,MAAM,mBAAmB,aACrB,IAAI,KACZ,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,CAiC9B,CAAC"}
|
|
@@ -56,6 +56,7 @@ const mergeParamsAndBody = (params, body) => ({
|
|
|
56
56
|
not: O.none,
|
|
57
57
|
in: O.none,
|
|
58
58
|
default: O.none,
|
|
59
|
+
nullable: O.none,
|
|
59
60
|
});
|
|
60
61
|
const transformInput = (parameters) => {
|
|
61
62
|
const transformedParameters = {};
|
|
@@ -91,6 +92,7 @@ const transformInput = (parameters) => {
|
|
|
91
92
|
not: O.none,
|
|
92
93
|
in: O.none,
|
|
93
94
|
default: O.none,
|
|
95
|
+
nullable: O.none,
|
|
94
96
|
};
|
|
95
97
|
};
|
|
96
98
|
/**
|
|
@@ -121,6 +123,7 @@ const blankOutputSchema = () => ({
|
|
|
121
123
|
not: O.none,
|
|
122
124
|
in: O.none,
|
|
123
125
|
default: O.none,
|
|
126
|
+
nullable: O.none,
|
|
124
127
|
});
|
|
125
128
|
const getApplicationJsonMediaType = (content) => {
|
|
126
129
|
if (!Object.keys(content).length)
|
|
@@ -53,6 +53,7 @@ describe('GenerateInputSchema', () => {
|
|
|
53
53
|
not: O.none,
|
|
54
54
|
in: O.none,
|
|
55
55
|
default: O.none,
|
|
56
|
+
nullable: O.none,
|
|
56
57
|
},
|
|
57
58
|
additionalProperties: O.none,
|
|
58
59
|
},
|
|
@@ -75,6 +76,7 @@ describe('GenerateInputSchema', () => {
|
|
|
75
76
|
not: O.none,
|
|
76
77
|
in: O.none,
|
|
77
78
|
default: O.none,
|
|
79
|
+
nullable: O.none,
|
|
78
80
|
},
|
|
79
81
|
additionalProperties: O.none,
|
|
80
82
|
},
|
|
@@ -129,6 +131,7 @@ describe('GenerateInputSchema', () => {
|
|
|
129
131
|
not: O.none,
|
|
130
132
|
in: O.none,
|
|
131
133
|
default: O.none,
|
|
134
|
+
nullable: O.none,
|
|
132
135
|
},
|
|
133
136
|
userId: {
|
|
134
137
|
type: O.some('integer'),
|
|
@@ -142,6 +145,7 @@ describe('GenerateInputSchema', () => {
|
|
|
142
145
|
not: O.none,
|
|
143
146
|
in: O.none,
|
|
144
147
|
default: O.none,
|
|
148
|
+
nullable: O.none,
|
|
145
149
|
},
|
|
146
150
|
title: {
|
|
147
151
|
type: O.some('string'),
|
|
@@ -155,6 +159,7 @@ describe('GenerateInputSchema', () => {
|
|
|
155
159
|
not: O.none,
|
|
156
160
|
in: O.none,
|
|
157
161
|
default: O.none,
|
|
162
|
+
nullable: O.none,
|
|
158
163
|
},
|
|
159
164
|
body: {
|
|
160
165
|
type: O.some('string'),
|
|
@@ -168,6 +173,7 @@ describe('GenerateInputSchema', () => {
|
|
|
168
173
|
not: O.none,
|
|
169
174
|
in: O.none,
|
|
170
175
|
default: O.none,
|
|
176
|
+
nullable: O.none,
|
|
171
177
|
},
|
|
172
178
|
}),
|
|
173
179
|
additionalProperties: O.some(false),
|
|
@@ -177,6 +183,7 @@ describe('GenerateInputSchema', () => {
|
|
|
177
183
|
not: O.none,
|
|
178
184
|
in: O.none,
|
|
179
185
|
default: O.none,
|
|
186
|
+
nullable: O.none,
|
|
180
187
|
}),
|
|
181
188
|
},
|
|
182
189
|
},
|
|
@@ -227,6 +234,7 @@ describe('GenerateInputSchema', () => {
|
|
|
227
234
|
not: O.none,
|
|
228
235
|
in: O.none,
|
|
229
236
|
default: O.none,
|
|
237
|
+
nullable: O.none,
|
|
230
238
|
},
|
|
231
239
|
properties: O.none,
|
|
232
240
|
additionalProperties: O.some(false),
|
|
@@ -237,6 +245,7 @@ describe('GenerateInputSchema', () => {
|
|
|
237
245
|
not: O.none,
|
|
238
246
|
in: O.none,
|
|
239
247
|
default: O.none,
|
|
248
|
+
nullable: O.none,
|
|
240
249
|
},
|
|
241
250
|
additionalProperties: O.none,
|
|
242
251
|
},
|
|
@@ -56,6 +56,7 @@ describe('GenerateInputType', () => {
|
|
|
56
56
|
not: O.none,
|
|
57
57
|
in: O.none,
|
|
58
58
|
default: O.none,
|
|
59
|
+
nullable: O.none,
|
|
59
60
|
},
|
|
60
61
|
userId: {
|
|
61
62
|
title: O.none,
|
|
@@ -69,6 +70,7 @@ describe('GenerateInputType', () => {
|
|
|
69
70
|
not: O.none,
|
|
70
71
|
in: O.none,
|
|
71
72
|
default: O.none,
|
|
73
|
+
nullable: O.none,
|
|
72
74
|
},
|
|
73
75
|
title: {
|
|
74
76
|
title: O.none,
|
|
@@ -82,6 +84,7 @@ describe('GenerateInputType', () => {
|
|
|
82
84
|
not: O.none,
|
|
83
85
|
in: O.none,
|
|
84
86
|
default: O.none,
|
|
87
|
+
nullable: O.none,
|
|
85
88
|
},
|
|
86
89
|
body: {
|
|
87
90
|
title: O.none,
|
|
@@ -95,6 +98,7 @@ describe('GenerateInputType', () => {
|
|
|
95
98
|
not: O.none,
|
|
96
99
|
in: O.none,
|
|
97
100
|
default: O.none,
|
|
101
|
+
nullable: O.none,
|
|
98
102
|
},
|
|
99
103
|
}),
|
|
100
104
|
additionalProperties: O.some(false),
|
|
@@ -104,6 +108,7 @@ describe('GenerateInputType', () => {
|
|
|
104
108
|
not: O.none,
|
|
105
109
|
in: O.none,
|
|
106
110
|
default: O.none,
|
|
111
|
+
nullable: O.none,
|
|
107
112
|
}),
|
|
108
113
|
},
|
|
109
114
|
},
|
|
@@ -130,6 +135,7 @@ describe('GenerateInputType', () => {
|
|
|
130
135
|
not: O.none,
|
|
131
136
|
in: O.some('body'),
|
|
132
137
|
default: O.none,
|
|
138
|
+
nullable: O.none,
|
|
133
139
|
},
|
|
134
140
|
userId: {
|
|
135
141
|
title: O.none,
|
|
@@ -143,6 +149,7 @@ describe('GenerateInputType', () => {
|
|
|
143
149
|
not: O.none,
|
|
144
150
|
in: O.some('body'),
|
|
145
151
|
default: O.none,
|
|
152
|
+
nullable: O.none,
|
|
146
153
|
},
|
|
147
154
|
title: {
|
|
148
155
|
title: O.none,
|
|
@@ -156,6 +163,7 @@ describe('GenerateInputType', () => {
|
|
|
156
163
|
not: O.none,
|
|
157
164
|
in: O.some('body'),
|
|
158
165
|
default: O.none,
|
|
166
|
+
nullable: O.none,
|
|
159
167
|
},
|
|
160
168
|
body: {
|
|
161
169
|
title: O.none,
|
|
@@ -169,6 +177,7 @@ describe('GenerateInputType', () => {
|
|
|
169
177
|
not: O.none,
|
|
170
178
|
in: O.some('body'),
|
|
171
179
|
default: O.none,
|
|
180
|
+
nullable: O.none,
|
|
172
181
|
},
|
|
173
182
|
}),
|
|
174
183
|
additionalProperties: O.some(false),
|
|
@@ -178,6 +187,7 @@ describe('GenerateInputType', () => {
|
|
|
178
187
|
not: O.none,
|
|
179
188
|
in: O.none,
|
|
180
189
|
default: O.none,
|
|
190
|
+
nullable: O.none,
|
|
181
191
|
};
|
|
182
192
|
expect(inputSchema).toEqual(expectedInputSchema);
|
|
183
193
|
});
|
|
@@ -206,6 +216,7 @@ describe('GenerateInputType', () => {
|
|
|
206
216
|
not: O.none,
|
|
207
217
|
in: O.none,
|
|
208
218
|
default: O.none,
|
|
219
|
+
nullable: O.none,
|
|
209
220
|
},
|
|
210
221
|
},
|
|
211
222
|
{
|
|
@@ -226,6 +237,7 @@ describe('GenerateInputType', () => {
|
|
|
226
237
|
not: O.none,
|
|
227
238
|
in: O.none,
|
|
228
239
|
default: O.none,
|
|
240
|
+
nullable: O.none,
|
|
229
241
|
},
|
|
230
242
|
},
|
|
231
243
|
]),
|
|
@@ -249,6 +261,7 @@ describe('GenerateInputType', () => {
|
|
|
249
261
|
not: O.none,
|
|
250
262
|
in: O.none,
|
|
251
263
|
default: O.none,
|
|
264
|
+
nullable: O.none,
|
|
252
265
|
},
|
|
253
266
|
title: {
|
|
254
267
|
title: O.none,
|
|
@@ -262,6 +275,7 @@ describe('GenerateInputType', () => {
|
|
|
262
275
|
not: O.none,
|
|
263
276
|
in: O.none,
|
|
264
277
|
default: O.none,
|
|
278
|
+
nullable: O.none,
|
|
265
279
|
},
|
|
266
280
|
body: {
|
|
267
281
|
title: O.none,
|
|
@@ -275,6 +289,7 @@ describe('GenerateInputType', () => {
|
|
|
275
289
|
not: O.none,
|
|
276
290
|
in: O.none,
|
|
277
291
|
default: O.none,
|
|
292
|
+
nullable: O.none,
|
|
278
293
|
},
|
|
279
294
|
}),
|
|
280
295
|
additionalProperties: O.some(false),
|
|
@@ -284,6 +299,7 @@ describe('GenerateInputType', () => {
|
|
|
284
299
|
not: O.none,
|
|
285
300
|
in: O.none,
|
|
286
301
|
default: O.none,
|
|
302
|
+
nullable: O.none,
|
|
287
303
|
}),
|
|
288
304
|
},
|
|
289
305
|
},
|
|
@@ -356,6 +372,7 @@ describe('GenerateInputType', () => {
|
|
|
356
372
|
not: O.none,
|
|
357
373
|
in: O.none,
|
|
358
374
|
default: O.none,
|
|
375
|
+
nullable: O.none,
|
|
359
376
|
}),
|
|
360
377
|
},
|
|
361
378
|
},
|
|
@@ -402,6 +419,7 @@ describe('GenerateInputType', () => {
|
|
|
402
419
|
not: O.none,
|
|
403
420
|
in: O.none,
|
|
404
421
|
default: O.none,
|
|
422
|
+
nullable: O.none,
|
|
405
423
|
},
|
|
406
424
|
userId: {
|
|
407
425
|
title: O.none,
|
|
@@ -415,6 +433,7 @@ describe('GenerateInputType', () => {
|
|
|
415
433
|
not: O.none,
|
|
416
434
|
in: O.none,
|
|
417
435
|
default: O.none,
|
|
436
|
+
nullable: O.none,
|
|
418
437
|
},
|
|
419
438
|
title: {
|
|
420
439
|
title: O.none,
|
|
@@ -428,6 +447,7 @@ describe('GenerateInputType', () => {
|
|
|
428
447
|
not: O.none,
|
|
429
448
|
in: O.none,
|
|
430
449
|
default: O.none,
|
|
450
|
+
nullable: O.none,
|
|
431
451
|
},
|
|
432
452
|
body: {
|
|
433
453
|
title: O.none,
|
|
@@ -441,6 +461,7 @@ describe('GenerateInputType', () => {
|
|
|
441
461
|
not: O.none,
|
|
442
462
|
in: O.none,
|
|
443
463
|
default: O.none,
|
|
464
|
+
nullable: O.none,
|
|
444
465
|
},
|
|
445
466
|
}),
|
|
446
467
|
additionalProperties: O.some(false),
|
|
@@ -450,6 +471,7 @@ describe('GenerateInputType', () => {
|
|
|
450
471
|
not: O.none,
|
|
451
472
|
in: O.none,
|
|
452
473
|
default: O.none,
|
|
474
|
+
nullable: O.none,
|
|
453
475
|
}),
|
|
454
476
|
},
|
|
455
477
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateOutput.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/GenerateOutput.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAKlC,OAAO,EACN,SAAS,EAET,eAAe,EACf,YAAY,EAEZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"GenerateOutput.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/GenerateOutput.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAKlC,OAAO,EACN,SAAS,EAET,eAAe,EACf,YAAY,EAEZ,MAAM,8BAA8B,CAAC;AA0CtC,eAAO,MAAM,2BAA2B,YAC9B,OAAO,MAAM,EAAE,eAAe,CAAC,KACtC,EAAE,MAAM,CAAC,KAAK,EAAE,eAAe,CAWjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,cACrB,EAAE,MAAM,CAAC,SAAS,CAAC,KAC5B,GAAG,UAAU,CAAC,KAAK,EAAE,YAAY,CAelC,CAAC;AAWH,eAAO,MAAM,mBAAmB,2BACP,MAAM,gBAChB,YAAY,KACxB,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAgB7B,CAAC"}
|
|
@@ -53,6 +53,7 @@ const blankOutputSchema = () => ({
|
|
|
53
53
|
not: O.none,
|
|
54
54
|
in: O.none,
|
|
55
55
|
default: O.none,
|
|
56
|
+
nullable: O.none,
|
|
56
57
|
});
|
|
57
58
|
const getContent = (response) => O.fold(() => ({ 'application/json': { schema: O.some(blankOutputSchema()) } }), (content) => content)(response.content);
|
|
58
59
|
const getApplicationJsonMediaType = (content) => {
|
|
@@ -62,6 +62,7 @@ describe('Generate output: ', () => {
|
|
|
62
62
|
not: O.none,
|
|
63
63
|
in: O.none,
|
|
64
64
|
default: O.none,
|
|
65
|
+
nullable: O.none,
|
|
65
66
|
},
|
|
66
67
|
userId: {
|
|
67
68
|
title: O.none,
|
|
@@ -75,6 +76,7 @@ describe('Generate output: ', () => {
|
|
|
75
76
|
not: O.none,
|
|
76
77
|
in: O.none,
|
|
77
78
|
default: O.none,
|
|
79
|
+
nullable: O.none,
|
|
78
80
|
},
|
|
79
81
|
title: {
|
|
80
82
|
title: O.none,
|
|
@@ -88,6 +90,7 @@ describe('Generate output: ', () => {
|
|
|
88
90
|
not: O.none,
|
|
89
91
|
in: O.none,
|
|
90
92
|
default: O.none,
|
|
93
|
+
nullable: O.none,
|
|
91
94
|
},
|
|
92
95
|
body: {
|
|
93
96
|
title: O.none,
|
|
@@ -101,6 +104,7 @@ describe('Generate output: ', () => {
|
|
|
101
104
|
not: O.none,
|
|
102
105
|
in: O.none,
|
|
103
106
|
default: O.none,
|
|
107
|
+
nullable: O.none,
|
|
104
108
|
},
|
|
105
109
|
}),
|
|
106
110
|
additionalProperties: O.some(false),
|
|
@@ -110,6 +114,7 @@ describe('Generate output: ', () => {
|
|
|
110
114
|
not: O.none,
|
|
111
115
|
in: O.none,
|
|
112
116
|
default: O.none,
|
|
117
|
+
nullable: O.none,
|
|
113
118
|
}),
|
|
114
119
|
},
|
|
115
120
|
}),
|
|
@@ -148,6 +153,7 @@ describe('Generate output: ', () => {
|
|
|
148
153
|
not: O.none,
|
|
149
154
|
in: O.none,
|
|
150
155
|
default: O.none,
|
|
156
|
+
nullable: O.none,
|
|
151
157
|
},
|
|
152
158
|
userId: {
|
|
153
159
|
title: O.none,
|
|
@@ -161,6 +167,7 @@ describe('Generate output: ', () => {
|
|
|
161
167
|
not: O.none,
|
|
162
168
|
in: O.none,
|
|
163
169
|
default: O.none,
|
|
170
|
+
nullable: O.none,
|
|
164
171
|
},
|
|
165
172
|
title: {
|
|
166
173
|
title: O.none,
|
|
@@ -174,6 +181,7 @@ describe('Generate output: ', () => {
|
|
|
174
181
|
not: O.none,
|
|
175
182
|
in: O.none,
|
|
176
183
|
default: O.none,
|
|
184
|
+
nullable: O.none,
|
|
177
185
|
},
|
|
178
186
|
body: {
|
|
179
187
|
title: O.none,
|
|
@@ -187,6 +195,7 @@ describe('Generate output: ', () => {
|
|
|
187
195
|
not: O.none,
|
|
188
196
|
in: O.none,
|
|
189
197
|
default: O.none,
|
|
198
|
+
nullable: O.none,
|
|
190
199
|
},
|
|
191
200
|
}),
|
|
192
201
|
additionalProperties: O.some(false),
|
|
@@ -196,6 +205,7 @@ describe('Generate output: ', () => {
|
|
|
196
205
|
not: O.none,
|
|
197
206
|
in: O.none,
|
|
198
207
|
default: O.none,
|
|
208
|
+
nullable: O.none,
|
|
199
209
|
}),
|
|
200
210
|
},
|
|
201
211
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaToTypescriptOptions.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/JsonSchemaToTypescriptOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"JsonSchemaToTypescriptOptions.d.ts","sourceRoot":"","sources":["../../../src/file-generators/types/JsonSchemaToTypescriptOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;;CAQzC,CAAC"}
|