@devlearning/swagger-generator 1.1.16 → 1.1.17

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.
Files changed (58) hide show
  1. package/.vscode/launch.json +28 -28
  2. package/README-OLD.md +209 -209
  3. package/README.md +277 -277
  4. package/dist/api.constants.js +22 -22
  5. package/dist/generator.d.ts +4 -0
  6. package/dist/generator.js +118 -4
  7. package/dist/generators-writers/angular/api-angular-writer.js +38 -38
  8. package/dist/generators-writers/angular/constants.js +24 -24
  9. package/dist/generators-writers/angular/model-angular-writer.js +6 -6
  10. package/dist/generators-writers/dart/model-dart-writer.d.ts +1 -0
  11. package/dist/generators-writers/dart/model-dart-writer.js +15 -14
  12. package/dist/generators-writers/dart/templates/api.mustache +143 -143
  13. package/dist/generators-writers/dart/templates/enum.mustache +14 -14
  14. package/dist/generators-writers/dart/templates/model.mustache +20 -23
  15. package/dist/generators-writers/nextjs/api-nextjs-writer.js +12 -12
  16. package/dist/generators-writers/nextjs/constants.js +4 -4
  17. package/dist/generators-writers/nextjs/model-nextjs-writer.js +6 -6
  18. package/dist/models/swagger/swagger-component.d.ts +2 -2
  19. package/dist/models/swagger/swagger-schema.d.ts +1 -0
  20. package/package.json +49 -49
  21. package/src/api.constants.ts +26 -26
  22. package/src/generator-old.ts +449 -449
  23. package/src/generator.ts +752 -625
  24. package/src/generators-writers/angular/api-angular-writer.ts +187 -187
  25. package/src/generators-writers/angular/constants.ts +36 -36
  26. package/src/generators-writers/angular/model-angular-writer.ts +65 -65
  27. package/src/generators-writers/angular/normalizator.ts +41 -41
  28. package/src/generators-writers/dart/api-dart-writer.ts +303 -303
  29. package/src/generators-writers/dart/model-dart-writer.ts +212 -209
  30. package/src/generators-writers/dart/models/import-definition-dart.ts +5 -5
  31. package/src/generators-writers/dart/normalizator.ts +72 -72
  32. package/src/generators-writers/dart/templates/api.mustache +143 -143
  33. package/src/generators-writers/dart/templates/enum.mustache +14 -14
  34. package/src/generators-writers/dart/templates/model.mustache +20 -23
  35. package/src/generators-writers/nextjs/api-nextjs-writer.ts +157 -157
  36. package/src/generators-writers/nextjs/constants.ts +5 -5
  37. package/src/generators-writers/nextjs/model-nextjs-writer.ts +61 -61
  38. package/src/generators-writers/utils.ts +93 -93
  39. package/src/index.ts +103 -103
  40. package/src/models/api-dto.ts +17 -17
  41. package/src/models/enum-value-dto.ts +3 -3
  42. package/src/models/model-dto.ts +9 -9
  43. package/src/models/parameter-dto.ts +7 -7
  44. package/src/models/property-dto.ts +4 -4
  45. package/src/models/swagger/swagger-component-property.ts +11 -11
  46. package/src/models/swagger/swagger-component.ts +17 -17
  47. package/src/models/swagger/swagger-content.ts +4 -4
  48. package/src/models/swagger/swagger-info.ts +3 -3
  49. package/src/models/swagger/swagger-method.ts +7 -7
  50. package/src/models/swagger/swagger-schema.ts +21 -20
  51. package/src/models/swagger/swagger.ts +38 -38
  52. package/src/models/type-dto.ts +7 -7
  53. package/src/swagger-downloader.ts +46 -46
  54. package/src/utils/logger.ts +73 -73
  55. package/src/utils/swagger-validator.ts +89 -89
  56. package/tsconfig.json +33 -33
  57. package/dist/templates/api.mustache +0 -29
  58. package/dist/templates/model.mustache +0 -18
@@ -1,210 +1,213 @@
1
- import fs, { readFileSync, writeFileSync } from 'fs';
2
- import { ModelDto } from '../../models/model-dto.js';
3
- import Mustache from 'mustache';
4
- import { Utils } from '../utils.js';
5
- import { CommandLineArgs } from '../../index.js';
6
- import { ImportDefinitionDart } from './models/import-definition-dart.js';
7
- import { Normalizator } from './normalizator.js';
8
- import path from 'path';
9
- import { fileURLToPath } from 'url';
10
-
11
- interface ClassDefinitionDart {
12
- className?: string;
13
- fields?: { name: string; type: string }[];
14
- imports?: string[];
15
- }
16
-
17
- interface EnumDefinitionDart {
18
- enumName?: string;
19
- fields?: EnumItemDefinitionDart[];
20
- imports?: string[];
21
- }
22
-
23
- interface EnumItemDefinitionDart {
24
- name: string;
25
- value: string;
26
- isLast: boolean;
27
- }
28
-
29
- interface FieldDefinitionDart {
30
- name: string;
31
- type: string;
32
- typeName: string;
33
- nullable: string;
34
- required: string;
35
- jsonKeyAnnotation?: string;
36
- defaultAnnotation?: string;
37
- }
38
-
39
- interface ExportClassDefinitionDart {
40
- classes: ClassDefinitionDart[];
41
- }
42
-
43
- interface ExportEnumDefinitionDart {
44
- classes: EnumDefinitionDart[];
45
- }
46
-
47
- interface ExportModelItemDefinitionDart {
48
- filename?: string;
49
- }
50
-
51
- export class ModelDartWriter {
52
- private _commandLineArgs: CommandLineArgs;
53
-
54
- constructor(commandLineArgs: CommandLineArgs) {
55
- this._commandLineArgs = commandLineArgs;
56
- }
57
-
58
- write(models: ModelDto[]) {
59
- this.writeEnums(models.filter(m => m.modelType === 'enum'));
60
- this.writeClasses(models);
61
- }
62
-
63
- writeClasses(models: ModelDto[]) {
64
- const __filename = fileURLToPath(import.meta.url);
65
- const __dirname = path.dirname(__filename);
66
- const templatePath = path.join(__dirname, 'templates', 'model.mustache');
67
- const template = readFileSync(templatePath, 'utf-8');
68
-
69
- let importDirectory = this._commandLineArgs.outputDirectory;
70
- if (importDirectory.startsWith('lib/')) {
71
- importDirectory = importDirectory.slice('lib/'.length);
72
- }
73
-
74
- models.forEach(model => {
75
- if (model.modelType === 'class' || model.modelType === 'interface') {
76
- const normalizedInfo = Normalizator.getNormalizedInfo(model);
77
- const dartModel = <ClassDefinitionDart>{
78
- filename: normalizedInfo.filename,
79
- path: this._commandLineArgs.outputDirectory,
80
- className: normalizedInfo.modelName,
81
- fields: [],
82
- imports: [],
83
- };
84
-
85
- var imports = <ImportDefinitionDart[]>[];
86
-
87
- const needsDartIo = model.properties.some(p => {
88
- const normalized = (p.typeName ?? '').trim();
89
- return normalized === 'File' || (p.isArray && normalized === 'File');
90
- });
91
-
92
- if (needsDartIo) {
93
- imports.push({
94
- type: { typeName: 'dart:io' } as any,
95
- import: `import 'dart:io';`
96
- });
97
- }
98
-
99
- model.properties.forEach(property => {
100
- var fieldTypeName = Normalizator.mapTsTypeToDart(property.typeName);
101
-
102
- fieldTypeName = Normalizator.getNormalizedTypeName(fieldTypeName);
103
-
104
- const isFileField = property.typeName === 'File';
105
- const isFileArrayField = isFileField && property.isArray === true;
106
- const jsonKeyAnnotation = isFileField
107
- ? "@JsonKey(includeFromJson: false, includeToJson: false)"
108
- : undefined;
109
- const defaultAnnotation = isFileArrayField
110
- ? "@Default(<File>[])"
111
- : undefined;
112
-
113
- // File fields are excluded from JSON serialization; they must not be `required` for fromJson.
114
- const nullable = isFileField && !property.isArray
115
- ? '?'
116
- : (property.nullable && !property.isArray ? '?' : '');
117
- const required = isFileField
118
- ? ''
119
- : (property.nullable && !property.isArray ? '' : 'required ');
120
-
121
- dartModel.fields!.push(<FieldDefinitionDart>{
122
- name: property.name,
123
- type: property.isArray ? `List<${fieldTypeName}>` : fieldTypeName,
124
- typeName: property.typeName,
125
- nullable,
126
- required,
127
- jsonKeyAnnotation,
128
- defaultAnnotation,
129
- });
130
-
131
- if (property.isTypeReference) {
132
- if (imports.findIndex(x => x.type.typeName == property.typeName) == -1) {
133
- models.forEach(currModel => {
134
- if (currModel.typeName === property.typeName) {
135
- const normalizedInfo = Normalizator.getNormalizedInfo(currModel);
136
- const importPath = this._buildImportPath(importDirectory, normalizedInfo.subPath, normalizedInfo.filename);
137
- imports.push({
138
- type: property,
139
- import: `import 'package:${this._commandLineArgs.package}/${importPath}';`
140
- });
141
- }
142
- });
143
- }
144
- }
145
- });
146
-
147
- dartModel.imports = imports.map(i => i.import);
148
-
149
- let destinationPath = `${this._commandLineArgs.outputDirectory}/${normalizedInfo.subPath}`;
150
-
151
- Utils.ensureDirectorySync(`${destinationPath}`);
152
-
153
- let result = Mustache.render(template, dartModel);
154
- writeFileSync(`${destinationPath}/${normalizedInfo.filename}.dart`, result, 'utf-8');
155
- }
156
- });
157
- }
158
-
159
- writeEnums(models: ModelDto[]) {
160
- const __filename = fileURLToPath(import.meta.url);
161
- const __dirname = path.dirname(__filename);
162
- const templatePath = path.join(__dirname, 'templates', 'enum.mustache');
163
- const template = readFileSync(templatePath, 'utf-8');
164
-
165
- let importDirectory = this._commandLineArgs.outputDirectory;
166
- if (importDirectory.startsWith('lib/')) {
167
- importDirectory = importDirectory.slice('lib/'.length);
168
- }
169
-
170
- models.forEach(model => {
171
- const normalizedInfo = Normalizator.getNormalizedInfo(model);
172
- const dartModel = <EnumDefinitionDart>{
173
- enumName: normalizedInfo.modelName,
174
- path: this._commandLineArgs.outputDirectory,
175
- fields: [],
176
- };
177
-
178
- model.enumValues.forEach(enumItem => {
179
- dartModel.fields!.push(<EnumItemDefinitionDart>{
180
- name: enumItem.name,
181
- value: enumItem.value,
182
- isLast: false,
183
- });
184
- });
185
-
186
- const lastIndex = dartModel.fields!.length - 1;
187
- dartModel.fields![lastIndex].isLast = true;
188
-
189
- let destinationPath = `${this._commandLineArgs.outputDirectory}/${normalizedInfo.subPath}`;
190
-
191
- Utils.ensureDirectorySync(`${destinationPath}`);
192
-
193
- let result = Mustache.render(template, dartModel);
194
- writeFileSync(`${destinationPath}/${normalizedInfo.filename}.dart`, result, 'utf-8');
195
- });
196
- }
197
-
198
- private _buildImportPath(importDirectory: string, subPath: string, filename: string): string {
199
- // Rimuove slash iniziali e finali da ogni parte
200
- const parts = [importDirectory, subPath]
201
- .filter(p => p && p.length > 0)
202
- .map(p => p.replace(/^\/+|\/+$/g, ''));
203
-
204
- // Aggiunge il filename alla fine
205
- parts.push(`${filename}.dart`);
206
-
207
- // Unisce con un singolo slash
208
- return parts.join('/');
209
- }
1
+ import fs, { readFileSync, writeFileSync } from 'fs';
2
+ import { ModelDto } from '../../models/model-dto.js';
3
+ import Mustache from 'mustache';
4
+ import { Utils } from '../utils.js';
5
+ import { CommandLineArgs } from '../../index.js';
6
+ import { ImportDefinitionDart } from './models/import-definition-dart.js';
7
+ import { Normalizator } from './normalizator.js';
8
+ import path from 'path';
9
+ import { fileURLToPath } from 'url';
10
+
11
+ interface ClassDefinitionDart {
12
+ className?: string;
13
+ fields?: { name: string; type: string }[];
14
+ imports?: string[];
15
+ }
16
+
17
+ interface EnumDefinitionDart {
18
+ enumName?: string;
19
+ fields?: EnumItemDefinitionDart[];
20
+ imports?: string[];
21
+ valueType?: string;
22
+ }
23
+
24
+ interface EnumItemDefinitionDart {
25
+ name: string;
26
+ value: string;
27
+ isLast: boolean;
28
+ }
29
+
30
+ interface FieldDefinitionDart {
31
+ name: string;
32
+ type: string;
33
+ typeName: string;
34
+ nullable: string;
35
+ required: string;
36
+ jsonKeyAnnotation?: string;
37
+ }
38
+
39
+ interface ExportClassDefinitionDart {
40
+ classes: ClassDefinitionDart[];
41
+ }
42
+
43
+ interface ExportEnumDefinitionDart {
44
+ classes: EnumDefinitionDart[];
45
+ }
46
+
47
+ interface ExportModelItemDefinitionDart {
48
+ filename?: string;
49
+ }
50
+
51
+ export class ModelDartWriter {
52
+ private _commandLineArgs: CommandLineArgs;
53
+
54
+ constructor(commandLineArgs: CommandLineArgs) {
55
+ this._commandLineArgs = commandLineArgs;
56
+ }
57
+
58
+ write(models: ModelDto[]) {
59
+ this.writeEnums(models.filter(m => m.modelType === 'enum'));
60
+ this.writeClasses(models);
61
+ }
62
+
63
+ writeClasses(models: ModelDto[]) {
64
+ const __filename = fileURLToPath(import.meta.url);
65
+ const __dirname = path.dirname(__filename);
66
+ const templatePath = path.join(__dirname, 'templates', 'model.mustache');
67
+ const template = readFileSync(templatePath, 'utf-8');
68
+
69
+ let importDirectory = this._commandLineArgs.outputDirectory;
70
+ if (importDirectory.startsWith('lib/')) {
71
+ importDirectory = importDirectory.slice('lib/'.length);
72
+ }
73
+
74
+ models.forEach(model => {
75
+ if (model.modelType === 'class' || model.modelType === 'interface') {
76
+ const normalizedInfo = Normalizator.getNormalizedInfo(model);
77
+ const dartModel = <ClassDefinitionDart>{
78
+ filename: normalizedInfo.filename,
79
+ path: this._commandLineArgs.outputDirectory,
80
+ className: normalizedInfo.modelName,
81
+ fields: [],
82
+ imports: [],
83
+ };
84
+
85
+ var imports = <ImportDefinitionDart[]>[];
86
+
87
+ const needsDartIo = model.properties.some(p => {
88
+ const normalized = (p.typeName ?? '').trim();
89
+ return normalized === 'File' || (p.isArray && normalized === 'File');
90
+ });
91
+
92
+ if (needsDartIo) {
93
+ imports.push({
94
+ type: { typeName: 'dart:io' } as any,
95
+ import: `import 'dart:io';`
96
+ });
97
+ }
98
+
99
+ model.properties.forEach(property => {
100
+ var fieldTypeName = Normalizator.mapTsTypeToDart(property.typeName);
101
+
102
+ fieldTypeName = Normalizator.getNormalizedTypeName(fieldTypeName);
103
+
104
+ const isFileField = property.typeName === 'File';
105
+ const jsonKeyAnnotation = isFileField
106
+ ? "@JsonKey(includeFromJson: false, includeToJson: false)"
107
+ : undefined;
108
+
109
+ dartModel.fields!.push(<FieldDefinitionDart>{
110
+ name: property.name,
111
+ type: property.isArray ? `List<${fieldTypeName}>` : fieldTypeName,
112
+ typeName: property.typeName,
113
+ nullable: property.nullable && !property.isArray ? '?' : '',
114
+ required: property.nullable && !property.isArray ? '' : 'required ',
115
+ jsonKeyAnnotation,
116
+ });
117
+
118
+ if (property.isTypeReference) {
119
+ if (imports.findIndex(x => x.type.typeName == property.typeName) == -1) {
120
+ models.forEach(currModel => {
121
+ if (currModel.typeName === property.typeName) {
122
+ const normalizedInfo = Normalizator.getNormalizedInfo(currModel);
123
+ const importPath = this._buildImportPath(importDirectory, normalizedInfo.subPath, normalizedInfo.filename);
124
+ imports.push({
125
+ type: property,
126
+ import: `import 'package:${this._commandLineArgs.package}/${importPath}';`
127
+ });
128
+ }
129
+ });
130
+ }
131
+ }
132
+ });
133
+
134
+ dartModel.imports = imports.map(i => i.import);
135
+
136
+ let destinationPath = `${this._commandLineArgs.outputDirectory}/${normalizedInfo.subPath}`;
137
+
138
+ Utils.ensureDirectorySync(`${destinationPath}`);
139
+
140
+ let result = Mustache.render(template, dartModel);
141
+ writeFileSync(`${destinationPath}/${normalizedInfo.filename}.dart`, result, 'utf-8');
142
+ }
143
+ });
144
+ }
145
+
146
+ writeEnums(models: ModelDto[]) {
147
+ const __filename = fileURLToPath(import.meta.url);
148
+ const __dirname = path.dirname(__filename);
149
+ const templatePath = path.join(__dirname, 'templates', 'enum.mustache');
150
+ const template = readFileSync(templatePath, 'utf-8');
151
+
152
+ let importDirectory = this._commandLineArgs.outputDirectory;
153
+ if (importDirectory.startsWith('lib/')) {
154
+ importDirectory = importDirectory.slice('lib/'.length);
155
+ }
156
+
157
+ models.forEach(model => {
158
+ const normalizedInfo = Normalizator.getNormalizedInfo(model);
159
+
160
+ const valueType = this._inferDartEnumValueType(model.enumValues);
161
+ const dartModel = <EnumDefinitionDart>{
162
+ enumName: normalizedInfo.modelName,
163
+ path: this._commandLineArgs.outputDirectory,
164
+ fields: [],
165
+ valueType,
166
+ };
167
+
168
+ model.enumValues.forEach(enumItem => {
169
+ dartModel.fields!.push(<EnumItemDefinitionDart>{
170
+ name: enumItem.name,
171
+ value: enumItem.value,
172
+ isLast: false,
173
+ });
174
+ });
175
+
176
+ const lastIndex = dartModel.fields!.length - 1;
177
+ dartModel.fields![lastIndex].isLast = true;
178
+
179
+ let destinationPath = `${this._commandLineArgs.outputDirectory}/${normalizedInfo.subPath}`;
180
+
181
+ Utils.ensureDirectorySync(`${destinationPath}`);
182
+
183
+ let result = Mustache.render(template, dartModel);
184
+ writeFileSync(`${destinationPath}/${normalizedInfo.filename}.dart`, result, 'utf-8');
185
+ });
186
+ }
187
+
188
+ private _inferDartEnumValueType(enumValues: { value: string }[]): string {
189
+ // If values are unquoted and numeric, assume int; otherwise String.
190
+ // Generator will quote string enums using JSON.stringify ("...").
191
+ if (!enumValues || enumValues.length === 0) return 'String';
192
+
193
+ const allNumeric = enumValues.every(v => {
194
+ const trimmed = (v.value ?? '').trim();
195
+ return /^-?\d+$/.test(trimmed);
196
+ });
197
+
198
+ return allNumeric ? 'int' : 'String';
199
+ }
200
+
201
+ private _buildImportPath(importDirectory: string, subPath: string, filename: string): string {
202
+ // Rimuove slash iniziali e finali da ogni parte
203
+ const parts = [importDirectory, subPath]
204
+ .filter(p => p && p.length > 0)
205
+ .map(p => p.replace(/^\/+|\/+$/g, ''));
206
+
207
+ // Aggiunge il filename alla fine
208
+ parts.push(`${filename}.dart`);
209
+
210
+ // Unisce con un singolo slash
211
+ return parts.join('/');
212
+ }
210
213
  }
@@ -1,6 +1,6 @@
1
- import { TypeDto } from "../../../models/type-dto.js";
2
-
3
- export interface ImportDefinitionDart {
4
- type: TypeDto;
5
- import: string
1
+ import { TypeDto } from "../../../models/type-dto.js";
2
+
3
+ export interface ImportDefinitionDart {
4
+ type: TypeDto;
5
+ import: string
6
6
  }
@@ -1,73 +1,73 @@
1
- import { ModelDto } from "../../models/model-dto.js";
2
- import { Utils } from "../utils.js";
3
-
4
- export class Normalizator {
5
-
6
- public static getNormalizedInfo(model: ModelDto) {
7
- let subPath = '';
8
- let filename = '';
9
- let modelName = '';
10
-
11
- if (model.name && model.name.includes('.')) {
12
- subPath = model.name.split('.').slice(0, -1).join('');
13
- subPath = `${Utils.toDartFileName(subPath)}/models`;
14
- filename = model.name.split('.').pop()!;
15
- modelName = Utils.toDartClassName(filename) ?? filename;
16
- filename = Utils.toDartFileName(filename!);
17
- } else {
18
- subPath = '';
19
- filename = Utils.toDartFileName(model.name);
20
- modelName = Utils.toDartClassName(model.name) ?? model.name;
21
- }
22
-
23
- return {
24
- filename: filename,
25
- subPath: subPath,
26
- modelName: modelName,
27
- }
28
- }
29
-
30
- public static getNormalizedTypeName(typeName: string): string {
31
- let formattedTypeName = typeName.split('.').pop()!;
32
- return Utils.toDartClassName(formattedTypeName) ?? typeName;
33
- }
34
-
35
- public static mapTsTypeToDart(type: string): string {
36
- const normalized = type.trim().toLowerCase();
37
-
38
- if (normalized.endsWith("[]")) {
39
- const inner = normalized.slice(0, -2).trim();
40
- return `List<${Normalizator.mapTsTypeToDart(inner)}>`;
41
- }
42
-
43
- switch (normalized) {
44
- case "string":
45
- case "uuid":
46
- case "date":
47
- return "String";
48
- case "dateTime":
49
- return "DateTime";
50
- case "number":
51
- case "float":
52
- case "double":
53
- return "double";
54
- case "integer":
55
- case "int":
56
- case "long":
57
- return "int";
58
- case "boolean":
59
- case "bool":
60
- return "bool";
61
- case "any":
62
- case "object":
63
- return "dynamic";
64
- case "null":
65
- case "undefined":
66
- return "Null";
67
- default:
68
- // per tipi personalizzati (es. modelli) restituisci con PascalCase
69
- return Utils.toPascalCase(type);
70
- }
71
- }
72
-
1
+ import { ModelDto } from "../../models/model-dto.js";
2
+ import { Utils } from "../utils.js";
3
+
4
+ export class Normalizator {
5
+
6
+ public static getNormalizedInfo(model: ModelDto) {
7
+ let subPath = '';
8
+ let filename = '';
9
+ let modelName = '';
10
+
11
+ if (model.name && model.name.includes('.')) {
12
+ subPath = model.name.split('.').slice(0, -1).join('');
13
+ subPath = `${Utils.toDartFileName(subPath)}/models`;
14
+ filename = model.name.split('.').pop()!;
15
+ modelName = Utils.toDartClassName(filename) ?? filename;
16
+ filename = Utils.toDartFileName(filename!);
17
+ } else {
18
+ subPath = '';
19
+ filename = Utils.toDartFileName(model.name);
20
+ modelName = Utils.toDartClassName(model.name) ?? model.name;
21
+ }
22
+
23
+ return {
24
+ filename: filename,
25
+ subPath: subPath,
26
+ modelName: modelName,
27
+ }
28
+ }
29
+
30
+ public static getNormalizedTypeName(typeName: string): string {
31
+ let formattedTypeName = typeName.split('.').pop()!;
32
+ return Utils.toDartClassName(formattedTypeName) ?? typeName;
33
+ }
34
+
35
+ public static mapTsTypeToDart(type: string): string {
36
+ const normalized = type.trim().toLowerCase();
37
+
38
+ if (normalized.endsWith("[]")) {
39
+ const inner = normalized.slice(0, -2).trim();
40
+ return `List<${Normalizator.mapTsTypeToDart(inner)}>`;
41
+ }
42
+
43
+ switch (normalized) {
44
+ case "string":
45
+ case "uuid":
46
+ case "date":
47
+ return "String";
48
+ case "dateTime":
49
+ return "DateTime";
50
+ case "number":
51
+ case "float":
52
+ case "double":
53
+ return "double";
54
+ case "integer":
55
+ case "int":
56
+ case "long":
57
+ return "int";
58
+ case "boolean":
59
+ case "bool":
60
+ return "bool";
61
+ case "any":
62
+ case "object":
63
+ return "dynamic";
64
+ case "null":
65
+ case "undefined":
66
+ return "Null";
67
+ default:
68
+ // per tipi personalizzati (es. modelli) restituisci con PascalCase
69
+ return Utils.toPascalCase(type);
70
+ }
71
+ }
72
+
73
73
  }