openapi-ts-generator 6.170.3 → 6.176.2
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/openapidoc-converter.js +4 -4
- package/package.json +1 -1
package/openapidoc-converter.js
CHANGED
|
@@ -245,7 +245,7 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
245
245
|
return __assign(__assign({}, this.convertReferenceObjectToPropertyType(parentTypeName, propertyName, schemaWrapperInfo)), { isArray: true });
|
|
246
246
|
};
|
|
247
247
|
OpenApiDocConverter.prototype.convertReferenceObjectToPropertyType = function (parentTypeName, propertyName, schemaWrapperInfo) {
|
|
248
|
-
var _a, _b;
|
|
248
|
+
var _a, _b, _c;
|
|
249
249
|
var propertySchema = (((_a = this.apiDocument.components) === null || _a === void 0 ? void 0 : _a.schemas) || {})[this.parseRef(schemaWrapperInfo)];
|
|
250
250
|
var refSchema = (((_b = schemaWrapperInfo === null || schemaWrapperInfo === void 0 ? void 0 : schemaWrapperInfo.componentSchemaObject) === null || _b === void 0 ? void 0 : _b.properties) || {})[propertyName];
|
|
251
251
|
var required = this.getIsRequired(propertyName, schemaWrapperInfo);
|
|
@@ -263,7 +263,7 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
263
263
|
referenceTypeName: typeName,
|
|
264
264
|
typeScriptType: typeName,
|
|
265
265
|
isArray: false,
|
|
266
|
-
isEnum: (propertySchema.enum
|
|
266
|
+
isEnum: ((_c = propertySchema === null || propertySchema === void 0 ? void 0 : propertySchema.enum) !== null && _c !== void 0 ? _c : []).length > 0,
|
|
267
267
|
hasValidators: validatorCount > 0,
|
|
268
268
|
hasMultipleValidators: validatorCount > 1,
|
|
269
269
|
maxLength: refSchema === null || refSchema === void 0 ? void 0 : refSchema.maxLength,
|
|
@@ -327,13 +327,13 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
327
327
|
.map(function (t) { return t.referenceTypeName; })
|
|
328
328
|
.filter(function (value, index, array) { return array.indexOf(value) === index; })
|
|
329
329
|
.map(function (value) {
|
|
330
|
-
var _a;
|
|
330
|
+
var _a, _b;
|
|
331
331
|
var refSchema = (((_a = _this.apiDocument.components) === null || _a === void 0 ? void 0 : _a.schemas) || {})[value];
|
|
332
332
|
var props = properties.filter(function (t) { return t.items.$ref === value || t.$ref === value; });
|
|
333
333
|
return {
|
|
334
334
|
name: value,
|
|
335
335
|
kebabCasedTypeName: (0, lodash_1.kebabCase)(value),
|
|
336
|
-
isEnum: (refSchema.enum
|
|
336
|
+
isEnum: ((_b = refSchema === null || refSchema === void 0 ? void 0 : refSchema.enum) !== null && _b !== void 0 ? _b : []).length > 0,
|
|
337
337
|
areAllArrays: props.every(function (val) { return val.type === 'array'; }),
|
|
338
338
|
hasArrays: props.some(function (val) { return val.type === 'array'; }),
|
|
339
339
|
isSelfReferencing: entityName === value,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-generator",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.176.2",
|
|
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
|
"types": "index.d.ts",
|