@asyncapi/cli 0.42.0 → 0.44.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.
|
@@ -39,9 +39,11 @@ export default class Models extends Command {
|
|
|
39
39
|
* C# specific options
|
|
40
40
|
*/
|
|
41
41
|
csharpAutoImplement: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
42
|
+
csharpNewtonsoft: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
42
43
|
csharpArrayType: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
43
44
|
csharpHashcode: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
44
45
|
csharpEqual: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
46
|
+
csharpSystemJson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
45
47
|
};
|
|
46
48
|
run(): Promise<void>;
|
|
47
49
|
}
|
|
@@ -26,7 +26,7 @@ class Models extends base_1.default {
|
|
|
26
26
|
run() {
|
|
27
27
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const { args, flags } = yield this.parse(Models);
|
|
29
|
-
const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, namespace, csharpAutoImplement, csharpArrayType, csharpHashcode, csharpEqual, packageName, output } = flags;
|
|
29
|
+
const { tsModelType, tsEnumType, tsIncludeComments, tsModuleSystem, tsExportType, tsJsonBinPack, namespace, csharpAutoImplement, csharpArrayType, csharpNewtonsoft, csharpHashcode, csharpEqual, csharpSystemJson, packageName, output } = flags;
|
|
30
30
|
const { language, file } = args;
|
|
31
31
|
const inputFile = (yield (0, SpecificationFile_1.load)(file)) || (yield (0, SpecificationFile_1.load)());
|
|
32
32
|
const { document, status } = yield (0, parser_1.parse)(this, inputFile, flags);
|
|
@@ -91,6 +91,12 @@ class Models extends base_1.default {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
if (csharpNewtonsoft) {
|
|
95
|
+
presets.push(modelina_1.CSHARP_NEWTONSOFT_SERIALIZER_PRESET);
|
|
96
|
+
}
|
|
97
|
+
if (csharpSystemJson) {
|
|
98
|
+
presets.push(modelina_1.CSHARP_JSON_SERIALIZER_PRESET);
|
|
99
|
+
}
|
|
94
100
|
if (csharpHashcode || csharpEqual) {
|
|
95
101
|
presets.push({
|
|
96
102
|
preset: modelina_1.CSHARP_COMMON_PRESET,
|
|
@@ -257,6 +263,10 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
|
|
|
257
263
|
description: 'C# specific, define whether to generate auto-implemented properties or not.',
|
|
258
264
|
required: false,
|
|
259
265
|
default: false
|
|
266
|
+
}), csharpNewtonsoft: core_1.Flags.boolean({
|
|
267
|
+
description: 'C# specific, generate the models with newtonsoft serialization support',
|
|
268
|
+
required: false,
|
|
269
|
+
default: false
|
|
260
270
|
}), csharpArrayType: core_1.Flags.string({
|
|
261
271
|
type: 'option',
|
|
262
272
|
description: 'C# specific, define which type of array needs to be generated.',
|
|
@@ -271,4 +281,8 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
|
|
|
271
281
|
description: 'C# specific, generate the models with the Equal method overwritten',
|
|
272
282
|
required: false,
|
|
273
283
|
default: false
|
|
284
|
+
}), csharpSystemJson: core_1.Flags.boolean({
|
|
285
|
+
description: 'C# specific, generate the models with System.Text.Json serialization support',
|
|
286
|
+
required: false,
|
|
287
|
+
default: false
|
|
274
288
|
}) }, (0, parser_1.validationFlags)({ logDiagnostics: false }));
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.44.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"bundle": {
|
|
5
5
|
"id": "bundle",
|
|
@@ -553,6 +553,13 @@
|
|
|
553
553
|
"required": false,
|
|
554
554
|
"allowNo": false
|
|
555
555
|
},
|
|
556
|
+
"csharpNewtonsoft": {
|
|
557
|
+
"name": "csharpNewtonsoft",
|
|
558
|
+
"type": "boolean",
|
|
559
|
+
"description": "C# specific, generate the models with newtonsoft serialization support",
|
|
560
|
+
"required": false,
|
|
561
|
+
"allowNo": false
|
|
562
|
+
},
|
|
556
563
|
"csharpArrayType": {
|
|
557
564
|
"name": "csharpArrayType",
|
|
558
565
|
"type": "option",
|
|
@@ -579,6 +586,13 @@
|
|
|
579
586
|
"required": false,
|
|
580
587
|
"allowNo": false
|
|
581
588
|
},
|
|
589
|
+
"csharpSystemJson": {
|
|
590
|
+
"name": "csharpSystemJson",
|
|
591
|
+
"type": "boolean",
|
|
592
|
+
"description": "C# specific, generate the models with System.Text.Json serialization support",
|
|
593
|
+
"required": false,
|
|
594
|
+
"allowNo": false
|
|
595
|
+
},
|
|
582
596
|
"log-diagnostics": {
|
|
583
597
|
"name": "log-diagnostics",
|
|
584
598
|
"type": "boolean",
|