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.
@@ -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
- return schemaWrapperInfo.propertySchemaObject.items.type;
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.284.4",
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",
@@ -5,7 +5,7 @@
5
5
  * For issues or feature request, visit the repo: https://github.com/ikemtz/openapi-ts-generator
6
6
  * Do not edit.
7
7
  */
8
- /* tslint:disable */
8
+ /* eslint-disable */
9
9
  export enum Endpoints {
10
10
  {{#paths}}
11
11
  {{tag}} = '{{endpoint}}',
@@ -5,7 +5,7 @@
5
5
  * For issues or feature request, visit the repo: https://github.com/ikemtz/openapi-ts-generator
6
6
  * Do not edit.
7
7
  */
8
- /* tslint:disable */
8
+ /* eslint-disable */
9
9
  {{#fileNames}}
10
10
  export * from './{{this}}';
11
11
  {{/fileNames}}
@@ -5,7 +5,7 @@
5
5
  * For issues or feature request, visit the repo: https://github.com/ikemtz/openapi-ts-generator
6
6
  * Do not edit.
7
7
  */
8
- /* tslint:disable */
8
+ /* eslint-disable */
9
9
  {{#if description}}/**
10
10
  * {{description}}
11
11
  */