openapi-ts-generator 10.48.14 → 10.49.3
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/generators/barrel.generator.js +2 -2
- package/generators/base.generator.d.ts +2 -1
- package/generators/base.generator.js +3 -6
- package/generators/endpoints.generator.js +5 -5
- package/generators/enum.generator.js +3 -3
- package/generators/form-group-factory.generator.js +5 -5
- package/generators/form.generator.js +3 -3
- package/generators/model-properties.generator.js +3 -3
- package/generators/model.generator.js +3 -4
- package/generators/test-object-factory.generator.js +3 -4
- package/jest.setup.d.ts +1 -0
- package/jest.setup.js +4 -0
- package/models/generator-options.js +3 -1
- package/models/logger.js +5 -3
- package/models/schema-info.js +3 -9
- package/models/utils.d.ts +1 -0
- package/models/utils.js +6 -0
- package/openapidoc-converter.js +16 -18
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { readdirSync } from 'node:fs';
|
|
2
2
|
import { BaseGenerator } from "./base.generator.js";
|
|
3
3
|
export class BarrelGenerator extends BaseGenerator {
|
|
4
|
-
GeneratorName = 'BarrelGenerator';
|
|
5
|
-
tsRegex = /.ts$/;
|
|
6
4
|
constructor(generatorOptions) {
|
|
7
5
|
super(generatorOptions, generatorOptions.templates?.barrel);
|
|
6
|
+
this.GeneratorName = 'BarrelGenerator';
|
|
7
|
+
this.tsRegex = /.ts$/;
|
|
8
8
|
}
|
|
9
9
|
generate() {
|
|
10
10
|
let fileNames = readdirSync(this.generatorOptions.outputPath).map((value) => value.replace(this.tsRegex, ''));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import handlebars from 'handlebars';
|
|
1
2
|
import { IGeneratorOptions } from '../models/generator-options.ts';
|
|
2
3
|
export declare abstract class BaseGenerator<TContextSchema> {
|
|
3
4
|
readonly generatorOptions: IGeneratorOptions;
|
|
4
5
|
readonly templateFilePath: string | undefined;
|
|
5
6
|
abstract readonly GeneratorName: string;
|
|
6
|
-
readonly template?:
|
|
7
|
+
readonly template?: handlebars.TemplateDelegate<TContextSchema>;
|
|
7
8
|
readonly emptyArrayRegex: RegExp;
|
|
8
9
|
constructor(generatorOptions: IGeneratorOptions, templateFilePath: string | undefined);
|
|
9
10
|
protected generateFile(outputFilePath: string, context: TContextSchema | null): string | null;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import handlebars from 'handlebars';
|
|
3
3
|
export class BaseGenerator {
|
|
4
|
-
generatorOptions;
|
|
5
|
-
templateFilePath;
|
|
6
|
-
template;
|
|
7
|
-
emptyArrayRegex = /, ]/g;
|
|
8
4
|
constructor(generatorOptions, templateFilePath) {
|
|
9
5
|
this.generatorOptions = generatorOptions;
|
|
10
6
|
this.templateFilePath = templateFilePath;
|
|
7
|
+
this.emptyArrayRegex = /, ]/g;
|
|
11
8
|
if (templateFilePath) {
|
|
12
9
|
const templateSource = readFileSync(templateFilePath, { encoding: 'utf8' });
|
|
13
|
-
this.template = compile(templateSource);
|
|
10
|
+
this.template = handlebars.compile(templateSource);
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
generateFile(outputFilePath, context) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import lodash from 'lodash';
|
|
2
2
|
import { BaseGenerator } from "./base.generator.js";
|
|
3
3
|
export class EndPointsGenerator extends BaseGenerator {
|
|
4
|
-
GeneratorName = 'EndPointsGenerator';
|
|
5
|
-
endpointIdentifierRegex = /[A-z0-9_-]*$/;
|
|
6
4
|
constructor(options) {
|
|
7
5
|
super(options, options.templates?.endpoints);
|
|
6
|
+
this.GeneratorName = 'EndPointsGenerator';
|
|
7
|
+
this.endpointIdentifierRegex = /[A-Za-z0-9_-]*$/;
|
|
8
8
|
}
|
|
9
9
|
generate(templateData) {
|
|
10
10
|
const paths = this.eliminateDupes(templateData);
|
|
@@ -14,13 +14,13 @@ export class EndPointsGenerator extends BaseGenerator {
|
|
|
14
14
|
const sortedTemplateData = [...templateData.paths].sort((x, y) => (x.endpoint.toUpperCase() < y.endpoint.toUpperCase() ? -1 : 1));
|
|
15
15
|
const result = [];
|
|
16
16
|
sortedTemplateData.forEach((val) => {
|
|
17
|
-
val = { ...val, tag: camelCase(val.tag) };
|
|
17
|
+
val = { ...val, tag: lodash.camelCase(val.tag) };
|
|
18
18
|
const dupeIndex = result.findIndex((f) => f.tag === val.tag);
|
|
19
19
|
if (dupeIndex > -1) {
|
|
20
20
|
const dupeCount = result.filter((f) => f.tag === val.tag).length + 1;
|
|
21
21
|
const endpointIdentifier = (this.endpointIdentifierRegex.exec(val.endpoint) || [])[0];
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
23
|
-
result.push({ ...val, tag: camelCase(`${val.tag}_${endpointIdentifier || dupeCount}`) });
|
|
23
|
+
result.push({ ...val, tag: lodash.camelCase(`${val.tag}_${endpointIdentifier || dupeCount}`) });
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
result.push(val);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import lodash from 'lodash';
|
|
2
2
|
import { BaseGenerator } from "./base.generator.js";
|
|
3
3
|
export class EnumGenerator extends BaseGenerator {
|
|
4
|
-
GeneratorName = 'EnumGenerator';
|
|
5
4
|
constructor(options) {
|
|
6
5
|
super(options, options.templates?.enum);
|
|
6
|
+
this.GeneratorName = 'EnumGenerator';
|
|
7
7
|
}
|
|
8
8
|
generate(templateData) {
|
|
9
9
|
templateData.entities
|
|
10
10
|
?.filter((entity) => entity.isEnum)
|
|
11
11
|
.forEach((entity) => {
|
|
12
|
-
super.generateFile(`${this.generatorOptions.outputPath}/${kebabCase(entity.name)}.enum.ts`, entity);
|
|
12
|
+
super.generateFile(`${this.generatorOptions.outputPath}/${lodash.kebabCase(entity.name)}.enum.ts`, entity);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import handlebars from 'handlebars';
|
|
3
|
+
import lodash from 'lodash';
|
|
4
4
|
import { BaseGenerator } from "./base.generator.js";
|
|
5
5
|
export class FormGroupFactoryGenerator extends BaseGenerator {
|
|
6
|
-
GeneratorName = 'FormGroupFactoryGenerator';
|
|
7
6
|
constructor(options) {
|
|
8
7
|
super(options, options.templates?.formGroupFactory);
|
|
8
|
+
this.GeneratorName = 'FormGroupFactoryGenerator';
|
|
9
9
|
}
|
|
10
10
|
generate(templateData) {
|
|
11
11
|
this.registerHelpers();
|
|
12
12
|
templateData.entities
|
|
13
13
|
?.filter((val) => val.valueProperties?.length + val.referenceProperties?.length > 0)
|
|
14
14
|
.forEach((entity) => {
|
|
15
|
-
super.generateFile(`${this.generatorOptions.outputPath}/${kebabCase(entity.name)}.form-group-fac.ts`, entity);
|
|
15
|
+
super.generateFile(`${this.generatorOptions.outputPath}/${lodash.kebabCase(entity.name)}.form-group-fac.ts`, entity);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
registerHelpers() {
|
|
@@ -25,7 +25,7 @@ export class FormGroupFactoryGenerator extends BaseGenerator {
|
|
|
25
25
|
this.registerValidatorHelper('pattern');
|
|
26
26
|
}
|
|
27
27
|
registerValidatorHelper(validatorName, angularValidatorName = validatorName) {
|
|
28
|
-
|
|
28
|
+
handlebars.registerHelper(`${validatorName}Validator`, (x, y) => this.validatorFactory(x, y, validatorName, angularValidatorName));
|
|
29
29
|
}
|
|
30
30
|
validatorFactory(propertyCollection, propertyContext, validationName, angularValidatorFunctionName) {
|
|
31
31
|
const props = propertyContext.data.root[propertyCollection];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
import
|
|
2
|
+
import lodash from 'lodash';
|
|
3
3
|
import { BaseGenerator } from "./base.generator.js";
|
|
4
4
|
export class FormGenerator extends BaseGenerator {
|
|
5
|
-
GeneratorName = 'FormGenerator';
|
|
6
5
|
constructor(options) {
|
|
7
6
|
super(options, options.templates?.form);
|
|
7
|
+
this.GeneratorName = 'FormGenerator';
|
|
8
8
|
}
|
|
9
9
|
generate(templateData) {
|
|
10
10
|
templateData.entities
|
|
11
11
|
?.filter((val) => val.valueProperties?.length + val.referenceProperties?.length > 0)
|
|
12
12
|
.forEach((entity) => {
|
|
13
|
-
super.generateFile(`${this.generatorOptions.outputPath}/${kebabCase(entity.name)}.form.ts`, entity);
|
|
13
|
+
super.generateFile(`${this.generatorOptions.outputPath}/${lodash.kebabCase(entity.name)}.form.ts`, entity);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
import
|
|
2
|
+
import lodash from 'lodash';
|
|
3
3
|
import { BaseGenerator } from "./base.generator.js";
|
|
4
4
|
export class ModelPropertiesGenerator extends BaseGenerator {
|
|
5
|
-
GeneratorName = 'ModelPropertiesGenerator';
|
|
6
5
|
constructor(options) {
|
|
7
6
|
super(options, options.templates?.modelProperties);
|
|
7
|
+
this.GeneratorName = 'ModelPropertiesGenerator';
|
|
8
8
|
}
|
|
9
9
|
generate(templateData) {
|
|
10
10
|
templateData.entities
|
|
11
11
|
?.filter((entity) => !entity.isEnum)
|
|
12
12
|
.filter((val) => val.valueProperties?.length > 0 || val.referenceProperties?.length > 0)
|
|
13
13
|
.forEach((entity) => {
|
|
14
|
-
super.generateFile(`${this.generatorOptions.outputPath}/${kebabCase(entity.name)}.properties.ts`, entity);
|
|
14
|
+
super.generateFile(`${this.generatorOptions.outputPath}/${lodash.kebabCase(entity.name)}.properties.ts`, entity);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import lodash from 'lodash';
|
|
2
2
|
import { BaseGenerator } from "./base.generator.js";
|
|
3
3
|
export class ModelGenerator extends BaseGenerator {
|
|
4
|
-
options;
|
|
5
|
-
GeneratorName = 'ModelGenerator';
|
|
6
4
|
constructor(options) {
|
|
7
5
|
super(options, options.genClasses ? options.templates?.entity : options.templates?.model);
|
|
8
6
|
this.options = options;
|
|
7
|
+
this.GeneratorName = 'ModelGenerator';
|
|
9
8
|
}
|
|
10
9
|
generate(templateData) {
|
|
11
10
|
const fileSuffix = this.options.genClasses ? '.entity.ts' : '.model.ts';
|
|
12
11
|
templateData.entities
|
|
13
12
|
?.filter((entity) => !entity.isEnum)
|
|
14
13
|
.forEach((entity) => {
|
|
15
|
-
super.generateFile(`${this.options.outputPath}/${kebabCase(entity.name)}${fileSuffix}`, entity);
|
|
14
|
+
super.generateFile(`${this.options.outputPath}/${lodash.kebabCase(entity.name)}${fileSuffix}`, entity);
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
import
|
|
2
|
+
import lodash from 'lodash';
|
|
3
3
|
import { BaseGenerator } from "./base.generator.js";
|
|
4
4
|
export class TestObjectFactoryGenerator extends BaseGenerator {
|
|
5
|
-
options;
|
|
6
|
-
GeneratorName = 'TestObjectFactoryGenerator';
|
|
7
5
|
constructor(options) {
|
|
8
6
|
super(options, options.templates?.testObjectFactory);
|
|
9
7
|
this.options = options;
|
|
8
|
+
this.GeneratorName = 'TestObjectFactoryGenerator';
|
|
10
9
|
}
|
|
11
10
|
generate(templateData) {
|
|
12
11
|
templateData.entities
|
|
13
12
|
?.filter((val) => val.valueProperties?.length + val.referenceProperties?.length > 0)
|
|
14
13
|
.forEach((entity) => {
|
|
15
|
-
super.generateFile(`${this.options.outputPath}/${kebabCase(entity.name)}.test-obj-fac.ts`, entity);
|
|
14
|
+
super.generateFile(`${this.options.outputPath}/${lodash.kebabCase(entity.name)}.test-obj-fac.ts`, entity);
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
}
|
package/jest.setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/jest.setup.js
ADDED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { resolve } from 'path';
|
|
2
|
+
import { resolve, } from 'node:path';
|
|
3
|
+
import { getDirName } from "./utils.js";
|
|
3
4
|
export function defaultFilter(_value, _index, _array) {
|
|
4
5
|
return true;
|
|
5
6
|
}
|
|
6
7
|
export function setGeneratorOptionDefaults(options) {
|
|
8
|
+
const __dirname = getDirName();
|
|
7
9
|
const templateFolder = resolve(`${__dirname}/..`, 'templates');
|
|
8
10
|
options.typeFilterCallBack = options.typeFilterCallBack ?? defaultFilter;
|
|
9
11
|
options.valuePropertyTypeFilterCallBack = options.valuePropertyTypeFilterCallBack ?? defaultFilter;
|
package/models/logger.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
export class MockConsoleLogger {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
constructor() {
|
|
4
|
+
this.log = (data) => { };
|
|
5
|
+
this.error = (data) => { };
|
|
6
|
+
this.warn = (data) => { };
|
|
7
|
+
}
|
|
6
8
|
}
|
package/models/schema-info.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { defaultFilter } from "./generator-options.js";
|
|
2
2
|
export class SchemaWrapperInfo {
|
|
3
|
-
propertySchemaObject = {};
|
|
4
|
-
propertyReferenceObject = { $ref: '' };
|
|
5
|
-
isEnum;
|
|
6
|
-
isCharEnum = false;
|
|
7
|
-
enumValues;
|
|
8
|
-
componentSchemaObject;
|
|
9
|
-
valueProperties;
|
|
10
|
-
referenceProperties;
|
|
11
|
-
description;
|
|
12
3
|
constructor(schemaItem) {
|
|
4
|
+
this.propertySchemaObject = {};
|
|
5
|
+
this.propertyReferenceObject = { $ref: '' };
|
|
6
|
+
this.isCharEnum = false;
|
|
13
7
|
this.componentSchemaObject = schemaItem;
|
|
14
8
|
this.description = schemaItem.description;
|
|
15
9
|
this.valueProperties = [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDirName: () => string;
|
package/models/utils.js
ADDED
package/openapidoc-converter.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-conversion */
|
|
2
2
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import pluralize from 'pluralize';
|
|
5
|
+
import lodash from 'lodash';
|
|
6
6
|
import { defaultFilter } from "./models/generator-options.js";
|
|
7
7
|
import { SchemaWrapperInfo } from "./models/schema-info.js";
|
|
8
8
|
export class OpenApiDocConverter {
|
|
9
|
-
options;
|
|
10
|
-
apiDocument;
|
|
11
|
-
endAlphaNumRegex = /[A-z0-9]*$/s;
|
|
12
|
-
startNumberregex = /^\d*/;
|
|
13
9
|
constructor(options, apiDocument) {
|
|
14
10
|
this.options = options;
|
|
15
11
|
this.apiDocument = apiDocument;
|
|
12
|
+
this.endAlphaNumRegex = /[A-z0-9]*$/s;
|
|
13
|
+
this.startNumberregex = /^\d*/;
|
|
16
14
|
}
|
|
17
15
|
convertDocument() {
|
|
18
16
|
const entities = this.convertEntities();
|
|
@@ -27,7 +25,7 @@ export class OpenApiDocConverter {
|
|
|
27
25
|
tagLookup = tagLookup || path.delete || path.patch;
|
|
28
26
|
const tag = (tagLookup?.tags || ['unknown_endpoint'])[0];
|
|
29
27
|
paths.push({
|
|
30
|
-
tag: snakeCase(tag),
|
|
28
|
+
tag: lodash.snakeCase(tag),
|
|
31
29
|
endpoint: this.options.pathUrlFormattingCallBack ? this.options.pathUrlFormattingCallBack(key) : key,
|
|
32
30
|
});
|
|
33
31
|
}
|
|
@@ -55,9 +53,9 @@ export class OpenApiDocConverter {
|
|
|
55
53
|
key: schemaWrapperInfo.isCharEnum ? t.key : +t.key,
|
|
56
54
|
}),
|
|
57
55
|
name: schemaName,
|
|
58
|
-
kebabCasedName: kebabCase(schemaName),
|
|
59
|
-
singularName: singular(schemaName),
|
|
60
|
-
camelSingularName: camelCase(singular(schemaName)),
|
|
56
|
+
kebabCasedName: lodash.kebabCase(schemaName),
|
|
57
|
+
singularName: pluralize.singular(schemaName),
|
|
58
|
+
camelSingularName: lodash.camelCase(pluralize.singular(schemaName)),
|
|
61
59
|
description: schemaWrapperInfo.description,
|
|
62
60
|
referenceProperties: schemaWrapperInfo.referenceProperties,
|
|
63
61
|
valueProperties: schemaWrapperInfo.valueProperties.filter(this.options.valuePropertyTypeFilterCallBack || defaultFilter),
|
|
@@ -77,8 +75,8 @@ export class OpenApiDocConverter {
|
|
|
77
75
|
return {
|
|
78
76
|
key: key ? +key : 0,
|
|
79
77
|
name,
|
|
80
|
-
titleName: startCase(name),
|
|
81
|
-
snakeCaseName: snakeCase(name).toUpperCase(),
|
|
78
|
+
titleName: lodash.startCase(name),
|
|
79
|
+
snakeCaseName: lodash.snakeCase(name).toUpperCase(),
|
|
82
80
|
};
|
|
83
81
|
}),
|
|
84
82
|
];
|
|
@@ -136,7 +134,7 @@ export class OpenApiDocConverter {
|
|
|
136
134
|
initialValue,
|
|
137
135
|
initialTestValue,
|
|
138
136
|
isArray: false,
|
|
139
|
-
snakeCaseName: snakeCase(propertyName).toUpperCase(),
|
|
137
|
+
snakeCaseName: lodash.snakeCase(propertyName).toUpperCase(),
|
|
140
138
|
typeScriptType: this.getPropertyTypeScriptType(schemaWrapperInfo),
|
|
141
139
|
maxLength: schemaWrapperInfo.propertySchemaObject.maxLength,
|
|
142
140
|
minLength: schemaWrapperInfo.propertySchemaObject.minLength,
|
|
@@ -172,7 +170,7 @@ export class OpenApiDocConverter {
|
|
|
172
170
|
email: false,
|
|
173
171
|
uri: false,
|
|
174
172
|
isArray: true,
|
|
175
|
-
snakeCaseName: snakeCase(propertyName).toUpperCase(),
|
|
173
|
+
snakeCaseName: lodash.snakeCase(propertyName).toUpperCase(),
|
|
176
174
|
hasMultipleValidators: false,
|
|
177
175
|
hasValidators: validatorCount > 0,
|
|
178
176
|
};
|
|
@@ -228,7 +226,7 @@ export class OpenApiDocConverter {
|
|
|
228
226
|
return `'${defaultValue.split(' ').pop()}'`;
|
|
229
227
|
}
|
|
230
228
|
else if (email) {
|
|
231
|
-
return `'${kebabCase(parentTypeName)}@email.org'`;
|
|
229
|
+
return `'${lodash.kebabCase(parentTypeName)}@email.org'`;
|
|
232
230
|
}
|
|
233
231
|
else if (typescriptType === 'Date') {
|
|
234
232
|
return 'new Date()';
|
|
@@ -246,7 +244,7 @@ export class OpenApiDocConverter {
|
|
|
246
244
|
return minValue ? `${minValue}` : '0';
|
|
247
245
|
}
|
|
248
246
|
else {
|
|
249
|
-
let retValue = snakeCase(propertyName).toUpperCase();
|
|
247
|
+
let retValue = lodash.snakeCase(propertyName).toUpperCase();
|
|
250
248
|
while (minLength && retValue.length < minLength) {
|
|
251
249
|
retValue = `${retValue}_${retValue}`;
|
|
252
250
|
}
|
|
@@ -277,7 +275,7 @@ export class OpenApiDocConverter {
|
|
|
277
275
|
isSameAsParentTypescriptType: parentTypeName.toLowerCase() === typeName.toLowerCase(),
|
|
278
276
|
initialValue,
|
|
279
277
|
initialTestValue,
|
|
280
|
-
snakeCaseName: snakeCase(propertyName).toUpperCase(),
|
|
278
|
+
snakeCaseName: lodash.snakeCase(propertyName).toUpperCase(),
|
|
281
279
|
referenceTypeName: typeName,
|
|
282
280
|
typeScriptType: typeName,
|
|
283
281
|
isArray: false,
|
|
@@ -353,7 +351,7 @@ export class OpenApiDocConverter {
|
|
|
353
351
|
const props = properties.filter((t) => t.items.$ref === value || t.$ref === value);
|
|
354
352
|
return {
|
|
355
353
|
name: value,
|
|
356
|
-
kebabCasedTypeName: kebabCase(value),
|
|
354
|
+
kebabCasedTypeName: lodash.kebabCase(value),
|
|
357
355
|
isEnum: (refSchema?.enum ?? []).length > 0,
|
|
358
356
|
areAllArrays: props.every((val) => val.type === 'array'),
|
|
359
357
|
hasArrays: props.some((val) => val.type === 'array'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-generator",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.49.3",
|
|
4
4
|
"description": "Based on swagger-ts-generator, this is a type script model generator specifically for services with OpenApi spec documentation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|