@devlearning/swagger-generator 1.1.15 → 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 +13 -0
  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 -20
  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 -195
  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 -20
  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,6 +1,6 @@
1
- export const API_PRE =
2
- `import axios from 'axios';
3
- import * as Models from './model.autogenerated';
4
- import { handleRequest, dateToZulu } from './utils/axios'
5
- import { isValid } from 'date-fns';
1
+ export const API_PRE =
2
+ `import axios from 'axios';
3
+ import * as Models from './model.autogenerated';
4
+ import { handleRequest, dateToZulu } from './utils/axios'
5
+ import { isValid } from 'date-fns';
6
6
  `;
@@ -1,62 +1,62 @@
1
- import fs from 'fs';
2
- import { ModelDto } from '../../models/model-dto.js';
3
-
4
- export class ModelNextJsWriter {
5
- private _outputDirectory: string;
6
-
7
- constructor(_outputDirectory: string) {
8
- this._outputDirectory = _outputDirectory;
9
- }
10
-
11
- write(models: ModelDto[]) {
12
- let modelString = '';
13
-
14
- models.forEach(model => {
15
- modelString += this._modelString(model);
16
- });
17
-
18
-
19
- this._writeFile(modelString);
20
- }
21
-
22
- private _modelString(model: ModelDto) {
23
- let modelString = `
24
- export ${model.modelType} ${model.name} {
25
- ${this._properties(model)}${this._enumValues(model)}
26
- }
27
- `;
28
-
29
- return modelString;
30
- }
31
-
32
- private _properties(model: ModelDto) {
33
- let propertiesString = '';
34
-
35
- model.properties.forEach(property => {
36
- //const libraryDate = this._commandLineArgs.dateTimeLibrary == DateTimeLibrary.Moment ? 'moment.Moment' : 'Date'
37
- const libraryDate = 'Date';
38
- const typeName = property.typeName === 'dateTime' ? libraryDate : property.typeName;
39
- propertiesString += ` ${property.name}${property.nullable ? '?' : ''}: ${typeName};\n`;
40
- });
41
-
42
- return propertiesString.trimEnd();
43
- }
44
-
45
- private _enumValues(model: ModelDto) {
46
- let enumValuesString = '';
47
-
48
- model.enumValues.forEach(enumValue => {
49
- enumValuesString += ` ${enumValue.name} = ${enumValue.value},\n`;
50
- });
51
-
52
- return enumValuesString.trimEnd();
53
- }
54
-
55
- private _writeFile(models: string) {
56
- fs.writeFileSync(this._outputDirectory + "/model.autogenerated.ts",
57
- `
58
- ${models}
59
- `,
60
- { flag: 'w' });
61
- }
1
+ import fs from 'fs';
2
+ import { ModelDto } from '../../models/model-dto.js';
3
+
4
+ export class ModelNextJsWriter {
5
+ private _outputDirectory: string;
6
+
7
+ constructor(_outputDirectory: string) {
8
+ this._outputDirectory = _outputDirectory;
9
+ }
10
+
11
+ write(models: ModelDto[]) {
12
+ let modelString = '';
13
+
14
+ models.forEach(model => {
15
+ modelString += this._modelString(model);
16
+ });
17
+
18
+
19
+ this._writeFile(modelString);
20
+ }
21
+
22
+ private _modelString(model: ModelDto) {
23
+ let modelString = `
24
+ export ${model.modelType} ${model.name} {
25
+ ${this._properties(model)}${this._enumValues(model)}
26
+ }
27
+ `;
28
+
29
+ return modelString;
30
+ }
31
+
32
+ private _properties(model: ModelDto) {
33
+ let propertiesString = '';
34
+
35
+ model.properties.forEach(property => {
36
+ //const libraryDate = this._commandLineArgs.dateTimeLibrary == DateTimeLibrary.Moment ? 'moment.Moment' : 'Date'
37
+ const libraryDate = 'Date';
38
+ const typeName = property.typeName === 'dateTime' ? libraryDate : property.typeName;
39
+ propertiesString += ` ${property.name}${property.nullable ? '?' : ''}: ${typeName};\n`;
40
+ });
41
+
42
+ return propertiesString.trimEnd();
43
+ }
44
+
45
+ private _enumValues(model: ModelDto) {
46
+ let enumValuesString = '';
47
+
48
+ model.enumValues.forEach(enumValue => {
49
+ enumValuesString += ` ${enumValue.name} = ${enumValue.value},\n`;
50
+ });
51
+
52
+ return enumValuesString.trimEnd();
53
+ }
54
+
55
+ private _writeFile(models: string) {
56
+ fs.writeFileSync(this._outputDirectory + "/model.autogenerated.ts",
57
+ `
58
+ ${models}
59
+ `,
60
+ { flag: 'w' });
61
+ }
62
62
  }
@@ -1,94 +1,94 @@
1
- import { SwaggerSchema } from "../models/swagger/swagger-schema.js";
2
- import fs from 'fs';
3
- import path from 'path';
4
-
5
- export class Utils {
6
-
7
- public static getNormalizedApiPathAngular(apiName: string) {
8
- let normalizedApiName = apiName.replace('/api/v{version}/', '').replaceAll('/', '_');
9
-
10
- if (normalizedApiName.charAt(0) == '_') {
11
- normalizedApiName = normalizedApiName.slice(1);
12
- }
13
-
14
- normalizedApiName = normalizedApiName.replaceAll('/', '_');
15
-
16
- return normalizedApiName;
17
- }
18
-
19
- public static getNormalizedApiPathDart(apiName: string) {
20
- // Remove path params like {id} from the method name.
21
- apiName = apiName.replace(/\{[^}]+\}/g, '');
22
-
23
- let normalizedApiName = apiName.replace('/api/v{version}/', '').replaceAll('/', '_');
24
-
25
- if (normalizedApiName.charAt(0) == '_') {
26
- normalizedApiName = normalizedApiName.slice(1);
27
- }
28
-
29
- normalizedApiName = normalizedApiName.replace(/-([a-zA-Z])/g, (_, char) => char.toUpperCase());
30
-
31
- normalizedApiName = this.toCamelCase(normalizedApiName);
32
-
33
- normalizedApiName = this.toFirstLetterLowercase(normalizedApiName);
34
-
35
- normalizedApiName = normalizedApiName.replaceAll('_', '');
36
-
37
- return normalizedApiName;
38
- }
39
-
40
- public static toFirstLetterLowercase(value: string) {
41
- return value.charAt(0).toLowerCase() + value.slice(1);
42
- }
43
-
44
- public static toCamelCase(input: string): string {
45
- return input.replace(/_([a-zA-Z])/g, (_, letter) => letter.toUpperCase());
46
- }
47
-
48
- public static toPascalCase(input: string): string {
49
- return input
50
- .replace(/[_\-\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ""))
51
- .replace(/^(.)/, (_, c) => c.toUpperCase());
52
- }
53
-
54
- public static isDate(schema?: SwaggerSchema) {
55
- if (!schema) return false;
56
-
57
- return schema.type == 'string' && schema.format == 'date-time';
58
- }
59
-
60
- public static toDartFileName(name: string): string {
61
- return name
62
- .replace(/\./g, '_') // sostituisce i punti con underscore
63
- .replace(/([a-z0-9])([A-Z])/g, '$1_$2') // aggiunge _ tra camelCase
64
- .toLowerCase();
65
- }
66
-
67
- public static toDartClassName(name: string): string | undefined {
68
- if (!name) return undefined;
69
-
70
- return name.replace(/\./g, ''); // rimuove i punti per ottenere PascalCase
71
- }
72
-
73
- public static ensureDirectorySync(dirPath: string) {
74
- if (!fs.existsSync(dirPath)) {
75
- fs.mkdirSync(dirPath, { recursive: true });
76
- }
77
- }
78
-
79
- public static clearDirectory(dirPath: string) {
80
- if (!fs.existsSync(dirPath)) return;
81
-
82
- for (const file of fs.readdirSync(dirPath)) {
83
- const fullPath = path.join(dirPath, file);
84
- const stat = fs.statSync(fullPath);
85
-
86
- if (stat.isDirectory()) {
87
- fs.rmSync(fullPath, { recursive: true, force: true });
88
- } else {
89
- fs.unlinkSync(fullPath);
90
- }
91
- }
92
- }
93
-
1
+ import { SwaggerSchema } from "../models/swagger/swagger-schema.js";
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ export class Utils {
6
+
7
+ public static getNormalizedApiPathAngular(apiName: string) {
8
+ let normalizedApiName = apiName.replace('/api/v{version}/', '').replaceAll('/', '_');
9
+
10
+ if (normalizedApiName.charAt(0) == '_') {
11
+ normalizedApiName = normalizedApiName.slice(1);
12
+ }
13
+
14
+ normalizedApiName = normalizedApiName.replaceAll('/', '_');
15
+
16
+ return normalizedApiName;
17
+ }
18
+
19
+ public static getNormalizedApiPathDart(apiName: string) {
20
+ // Remove path params like {id} from the method name.
21
+ apiName = apiName.replace(/\{[^}]+\}/g, '');
22
+
23
+ let normalizedApiName = apiName.replace('/api/v{version}/', '').replaceAll('/', '_');
24
+
25
+ if (normalizedApiName.charAt(0) == '_') {
26
+ normalizedApiName = normalizedApiName.slice(1);
27
+ }
28
+
29
+ normalizedApiName = normalizedApiName.replace(/-([a-zA-Z])/g, (_, char) => char.toUpperCase());
30
+
31
+ normalizedApiName = this.toCamelCase(normalizedApiName);
32
+
33
+ normalizedApiName = this.toFirstLetterLowercase(normalizedApiName);
34
+
35
+ normalizedApiName = normalizedApiName.replaceAll('_', '');
36
+
37
+ return normalizedApiName;
38
+ }
39
+
40
+ public static toFirstLetterLowercase(value: string) {
41
+ return value.charAt(0).toLowerCase() + value.slice(1);
42
+ }
43
+
44
+ public static toCamelCase(input: string): string {
45
+ return input.replace(/_([a-zA-Z])/g, (_, letter) => letter.toUpperCase());
46
+ }
47
+
48
+ public static toPascalCase(input: string): string {
49
+ return input
50
+ .replace(/[_\-\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ""))
51
+ .replace(/^(.)/, (_, c) => c.toUpperCase());
52
+ }
53
+
54
+ public static isDate(schema?: SwaggerSchema) {
55
+ if (!schema) return false;
56
+
57
+ return schema.type == 'string' && schema.format == 'date-time';
58
+ }
59
+
60
+ public static toDartFileName(name: string): string {
61
+ return name
62
+ .replace(/\./g, '_') // sostituisce i punti con underscore
63
+ .replace(/([a-z0-9])([A-Z])/g, '$1_$2') // aggiunge _ tra camelCase
64
+ .toLowerCase();
65
+ }
66
+
67
+ public static toDartClassName(name: string): string | undefined {
68
+ if (!name) return undefined;
69
+
70
+ return name.replace(/\./g, ''); // rimuove i punti per ottenere PascalCase
71
+ }
72
+
73
+ public static ensureDirectorySync(dirPath: string) {
74
+ if (!fs.existsSync(dirPath)) {
75
+ fs.mkdirSync(dirPath, { recursive: true });
76
+ }
77
+ }
78
+
79
+ public static clearDirectory(dirPath: string) {
80
+ if (!fs.existsSync(dirPath)) return;
81
+
82
+ for (const file of fs.readdirSync(dirPath)) {
83
+ const fullPath = path.join(dirPath, file);
84
+ const stat = fs.statSync(fullPath);
85
+
86
+ if (stat.isDirectory()) {
87
+ fs.rmSync(fullPath, { recursive: true, force: true });
88
+ } else {
89
+ fs.unlinkSync(fullPath);
90
+ }
91
+ }
92
+ }
93
+
94
94
  }
package/src/index.ts CHANGED
@@ -1,104 +1,104 @@
1
- #!/usr/bin/env node
2
-
3
- import yargs from 'yargs';
4
- import { hideBin } from 'yargs/helpers';
5
- import { Generator } from './generator.js';
6
- import { SwaggerDownloader } from './swagger-downloader.js';
7
-
8
- export enum DateTimeLibrary {
9
- Moment = 'moment',
10
- DateFns = 'date-fn',
11
- }
12
-
13
- export enum TargetGeneration {
14
- Angular = 'angular',
15
- Next = 'next',
16
- Flutter = 'flutter',
17
- }
18
-
19
- export interface CommandLineArgs {
20
- swaggerJsonUrl: string;
21
- outputDirectory: string;
22
- target: TargetGeneration;
23
- dateTimeLibrary?: DateTimeLibrary;
24
- package?: string;
25
- apiClientName?: string;
26
- }
27
-
28
- const argv = yargs(hideBin(process.argv))
29
- .scriptName("swagger-gen")
30
- .usage('Usage: $0 --url <swaggerJsonUrl> --output <outputDirectory> --target <target> [--dateTimeLibrary <dateTimeLibrary>] [--package <name>] [--api-client-name <className>]')
31
- .option('url', {
32
- alias: 'u',
33
- type: 'string',
34
- demandOption: true,
35
- describe: 'URL of swagger.json file',
36
- })
37
- .option('output', {
38
- alias: 'o',
39
- type: 'string',
40
- demandOption: true,
41
- describe: 'Output directory for generated code',
42
- })
43
- .option('target', {
44
- alias: 't',
45
- type: 'string',
46
- choices: ['angular', 'next', 'flutter'],
47
- demandOption: true,
48
- describe: 'Target format for the generated code',
49
- })
50
- .option('dateTimeLibrary', {
51
- alias: 'd',
52
- type: 'string',
53
- choices: ['moment', 'date-fns'],
54
- default: 'date-fns',
55
- describe: 'Date library to use for date handling',
56
- })
57
- .option('package', {
58
- alias: 'p',
59
- type: 'string',
60
- describe: 'For Dart: package name for Dart project',
61
- })
62
- .option('api-client-name', {
63
- alias: 'a',
64
- type: 'string',
65
- describe: 'Name for the unified API client class (all services in one class)',
66
- })
67
- .help()
68
- .parseSync();
69
-
70
- const commandLineArgs: CommandLineArgs = {
71
- swaggerJsonUrl: argv.url,
72
- outputDirectory: argv.output,
73
- target: parseTargetGeneration(argv.target),
74
- dateTimeLibrary: parseDateTimeLibrary(argv.dateTimeLibrary),
75
- package: argv.package ?? '',
76
- apiClientName: argv['api-client-name'],
77
- };
78
-
79
- const swaggerDownloader = new SwaggerDownloader();
80
-
81
- swaggerDownloader.download(new URL(commandLineArgs.swaggerJsonUrl))
82
- .then(swaggerDoc => {
83
- return new Generator(swaggerDoc, commandLineArgs);
84
- })
85
- .then(generator => { generator.generate(); });
86
-
87
-
88
- // require('./index.js')({swaggerDownloader});
89
-
90
- function parseDateTimeLibrary(value: string): DateTimeLibrary | undefined {
91
- const values = Object.values(DateTimeLibrary);
92
- if (values.includes(value as DateTimeLibrary)) {
93
- return value as DateTimeLibrary;
94
- }
95
- return undefined;
96
- }
97
-
98
- function parseTargetGeneration(value: string): TargetGeneration {
99
- const values = Object.values(TargetGeneration);
100
- if (values.includes(value as TargetGeneration)) {
101
- return value as TargetGeneration;
102
- }
103
- throw new Error(`Invalid OutputFormat: ${value}`);
1
+ #!/usr/bin/env node
2
+
3
+ import yargs from 'yargs';
4
+ import { hideBin } from 'yargs/helpers';
5
+ import { Generator } from './generator.js';
6
+ import { SwaggerDownloader } from './swagger-downloader.js';
7
+
8
+ export enum DateTimeLibrary {
9
+ Moment = 'moment',
10
+ DateFns = 'date-fn',
11
+ }
12
+
13
+ export enum TargetGeneration {
14
+ Angular = 'angular',
15
+ Next = 'next',
16
+ Flutter = 'flutter',
17
+ }
18
+
19
+ export interface CommandLineArgs {
20
+ swaggerJsonUrl: string;
21
+ outputDirectory: string;
22
+ target: TargetGeneration;
23
+ dateTimeLibrary?: DateTimeLibrary;
24
+ package?: string;
25
+ apiClientName?: string;
26
+ }
27
+
28
+ const argv = yargs(hideBin(process.argv))
29
+ .scriptName("swagger-gen")
30
+ .usage('Usage: $0 --url <swaggerJsonUrl> --output <outputDirectory> --target <target> [--dateTimeLibrary <dateTimeLibrary>] [--package <name>] [--api-client-name <className>]')
31
+ .option('url', {
32
+ alias: 'u',
33
+ type: 'string',
34
+ demandOption: true,
35
+ describe: 'URL of swagger.json file',
36
+ })
37
+ .option('output', {
38
+ alias: 'o',
39
+ type: 'string',
40
+ demandOption: true,
41
+ describe: 'Output directory for generated code',
42
+ })
43
+ .option('target', {
44
+ alias: 't',
45
+ type: 'string',
46
+ choices: ['angular', 'next', 'flutter'],
47
+ demandOption: true,
48
+ describe: 'Target format for the generated code',
49
+ })
50
+ .option('dateTimeLibrary', {
51
+ alias: 'd',
52
+ type: 'string',
53
+ choices: ['moment', 'date-fns'],
54
+ default: 'date-fns',
55
+ describe: 'Date library to use for date handling',
56
+ })
57
+ .option('package', {
58
+ alias: 'p',
59
+ type: 'string',
60
+ describe: 'For Dart: package name for Dart project',
61
+ })
62
+ .option('api-client-name', {
63
+ alias: 'a',
64
+ type: 'string',
65
+ describe: 'Name for the unified API client class (all services in one class)',
66
+ })
67
+ .help()
68
+ .parseSync();
69
+
70
+ const commandLineArgs: CommandLineArgs = {
71
+ swaggerJsonUrl: argv.url,
72
+ outputDirectory: argv.output,
73
+ target: parseTargetGeneration(argv.target),
74
+ dateTimeLibrary: parseDateTimeLibrary(argv.dateTimeLibrary),
75
+ package: argv.package ?? '',
76
+ apiClientName: argv['api-client-name'],
77
+ };
78
+
79
+ const swaggerDownloader = new SwaggerDownloader();
80
+
81
+ swaggerDownloader.download(new URL(commandLineArgs.swaggerJsonUrl))
82
+ .then(swaggerDoc => {
83
+ return new Generator(swaggerDoc, commandLineArgs);
84
+ })
85
+ .then(generator => { generator.generate(); });
86
+
87
+
88
+ // require('./index.js')({swaggerDownloader});
89
+
90
+ function parseDateTimeLibrary(value: string): DateTimeLibrary | undefined {
91
+ const values = Object.values(DateTimeLibrary);
92
+ if (values.includes(value as DateTimeLibrary)) {
93
+ return value as DateTimeLibrary;
94
+ }
95
+ return undefined;
96
+ }
97
+
98
+ function parseTargetGeneration(value: string): TargetGeneration {
99
+ const values = Object.values(TargetGeneration);
100
+ if (values.includes(value as TargetGeneration)) {
101
+ return value as TargetGeneration;
102
+ }
103
+ throw new Error(`Invalid OutputFormat: ${value}`);
104
104
  }
@@ -1,18 +1,18 @@
1
- import { ParameterDto } from "./parameter-dto.js";
2
- import { SwaggerMethod } from "./swagger/swagger-method.js";
3
- import { TypeDto } from "./type-dto.js";
4
-
5
- export interface ApiDto {
6
- name: string;
7
- method: string;
8
- url: string;
9
- description?: string;
10
- parameters: ParameterDto[];
11
- returnType: TypeDto | undefined;
12
- haveRequest: boolean;
13
- isMultiPart: boolean;
14
- tag: string;
15
-
16
- swaggerMethodKey: { [key: string]: SwaggerMethod; };
17
- swaggerMethod: SwaggerMethod;
1
+ import { ParameterDto } from "./parameter-dto.js";
2
+ import { SwaggerMethod } from "./swagger/swagger-method.js";
3
+ import { TypeDto } from "./type-dto.js";
4
+
5
+ export interface ApiDto {
6
+ name: string;
7
+ method: string;
8
+ url: string;
9
+ description?: string;
10
+ parameters: ParameterDto[];
11
+ returnType: TypeDto | undefined;
12
+ haveRequest: boolean;
13
+ isMultiPart: boolean;
14
+ tag: string;
15
+
16
+ swaggerMethodKey: { [key: string]: SwaggerMethod; };
17
+ swaggerMethod: SwaggerMethod;
18
18
  }
@@ -1,4 +1,4 @@
1
- export interface EnumValueDto {
2
- name: string;
3
- value: string;
1
+ export interface EnumValueDto {
2
+ name: string;
3
+ value: string;
4
4
  }
@@ -1,10 +1,10 @@
1
- import { EnumValueDto } from "./enum-value-dto.js";
2
- import { PropertyDto } from "./property-dto.js";
3
-
4
- export interface ModelDto {
5
- typeName: string;
6
- modelType: 'enum' | 'interface' | 'class';
7
- name: string;
8
- properties: PropertyDto[];
9
- enumValues: EnumValueDto[];
1
+ import { EnumValueDto } from "./enum-value-dto.js";
2
+ import { PropertyDto } from "./property-dto.js";
3
+
4
+ export interface ModelDto {
5
+ typeName: string;
6
+ modelType: 'enum' | 'interface' | 'class';
7
+ name: string;
8
+ properties: PropertyDto[];
9
+ enumValues: EnumValueDto[];
10
10
  }
@@ -1,8 +1,8 @@
1
- import { PropertyDto } from "./property-dto.js";
2
- import { SwaggerParameter } from "./swagger/swagger.js";
3
-
4
- export interface ParameterDto extends PropertyDto {
5
- isQuery: boolean;
6
- isEnum: boolean;
7
- swaggerParameter?: SwaggerParameter;
1
+ import { PropertyDto } from "./property-dto.js";
2
+ import { SwaggerParameter } from "./swagger/swagger.js";
3
+
4
+ export interface ParameterDto extends PropertyDto {
5
+ isQuery: boolean;
6
+ isEnum: boolean;
7
+ swaggerParameter?: SwaggerParameter;
8
8
  }
@@ -1,5 +1,5 @@
1
- import { TypeDto } from "./type-dto.js";
2
-
3
- export interface PropertyDto extends TypeDto {
4
- name: string;
1
+ import { TypeDto } from "./type-dto.js";
2
+
3
+ export interface PropertyDto extends TypeDto {
4
+ name: string;
5
5
  }
@@ -1,12 +1,12 @@
1
- import { SwaggerSchema } from "./swagger-schema.js";
2
-
3
- // export interface SwaggerComponentProperty {
4
- // type: string;
5
- // $ref: string;
6
- // allOf: SwaggerComponentProperty[];
7
- // format: string;
8
- // items: SwaggerSchema;
9
- // properties: { [key: string]: SwaggerComponentProperty; };
10
- // nullable: boolean;
11
- // minLength: number;
1
+ import { SwaggerSchema } from "./swagger-schema.js";
2
+
3
+ // export interface SwaggerComponentProperty {
4
+ // type: string;
5
+ // $ref: string;
6
+ // allOf: SwaggerComponentProperty[];
7
+ // format: string;
8
+ // items: SwaggerSchema;
9
+ // properties: { [key: string]: SwaggerComponentProperty; };
10
+ // nullable: boolean;
11
+ // minLength: number;
12
12
  // }