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