@asyncapi/cli 0.42.0 → 0.43.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,6 +39,7 @@ 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>;
@@ -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, 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,17 @@ 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 (csharpAutoImplement) {
98
+ presets.push({
99
+ preset: modelina_1.CSHARP_DEFAULT_PRESET,
100
+ options: {
101
+ autoImplementedProperties: true
102
+ }
103
+ });
104
+ }
94
105
  if (csharpHashcode || csharpEqual) {
95
106
  presets.push({
96
107
  preset: modelina_1.CSHARP_COMMON_PRESET,
@@ -257,6 +268,10 @@ Models.flags = Object.assign({ help: core_1.Flags.help({ char: 'h' }), output: c
257
268
  description: 'C# specific, define whether to generate auto-implemented properties or not.',
258
269
  required: false,
259
270
  default: false
271
+ }), csharpNewtonsoft: core_1.Flags.boolean({
272
+ description: 'C# specific, generate the models with newtonsoft serialization support',
273
+ required: false,
274
+ default: false
260
275
  }), csharpArrayType: core_1.Flags.string({
261
276
  type: 'option',
262
277
  description: 'C# specific, define which type of array needs to be generated.',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.42.0",
2
+ "version": "0.43.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",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asyncapi/cli",
3
3
  "description": "All in one CLI for all AsyncAPI tools",
4
- "version": "0.42.0",
4
+ "version": "0.43.0",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"