openapi-ts-generator 7.284.4 → 7.305.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
CHANGED
|
@@ -230,6 +230,12 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
230
230
|
else if (typescriptType === 'boolean') {
|
|
231
231
|
return 'false';
|
|
232
232
|
}
|
|
233
|
+
else if (typescriptType === 'number' && schemaObject.type === 'array') {
|
|
234
|
+
return minValue ? "[".concat(minValue, "]") : '[0]';
|
|
235
|
+
}
|
|
236
|
+
else if (schemaObject.type === 'array') {
|
|
237
|
+
return defaultValue ? "[".concat(defaultValue, "]") : '[]';
|
|
238
|
+
}
|
|
233
239
|
else if (typescriptType === 'number') {
|
|
234
240
|
return minValue ? "".concat(minValue) : '0';
|
|
235
241
|
}
|
|
@@ -293,7 +299,8 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
293
299
|
OpenApiDocConverter.prototype.getPropertyTypeScriptType = function (schemaWrapperInfo) {
|
|
294
300
|
var _a;
|
|
295
301
|
if (schemaWrapperInfo.propertySchemaObject.type === 'array' && schemaWrapperInfo.propertySchemaObject.items) {
|
|
296
|
-
|
|
302
|
+
var type = schemaWrapperInfo.propertySchemaObject.items.type;
|
|
303
|
+
return type === 'integer' ? 'number' : type;
|
|
297
304
|
}
|
|
298
305
|
else if (schemaWrapperInfo.propertySchemaObject.type === 'integer' && schemaWrapperInfo.propertySchemaObject.enum) {
|
|
299
306
|
return 'string | number';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-generator",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.305.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",
|
package/templates/index.ts.hbs
CHANGED