openapi-ts-generator 4.89.3 → 4.89.5

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.
@@ -13,6 +13,7 @@ export declare class OpenApiDocConverter {
13
13
  buildSchemaWrapperInfo(schemaWrapperInfo: SchemaWrapperInfo): void;
14
14
  convertArray(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): void;
15
15
  convertSchemaObjectToPropertyType(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IValueProperty;
16
+ private convertValidator;
16
17
  convertArrayObjectToValuePropertyType(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IValueProperty;
17
18
  convertArrayObjectToReferencePropertyType(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IReferenceProperty;
18
19
  convertReferenceObjectToPropertyType(propertyName: string, schemaWrapperInfo: SchemaWrapperInfo): IReferenceProperty;
@@ -102,14 +102,18 @@ var OpenApiDocConverter = /** @class */ (function () {
102
102
  description: schemaWrapperInfo.propertySchemaObject.description,
103
103
  pattern: schemaWrapperInfo.propertySchemaObject.pattern,
104
104
  hasMultipleValidators: +required +
105
- +!!schemaWrapperInfo.propertySchemaObject.maxLength +
106
- +!!schemaWrapperInfo.propertySchemaObject.minLength +
107
- +!!schemaWrapperInfo.propertySchemaObject.maximum +
108
- +!!schemaWrapperInfo.propertySchemaObject.minimum +
109
- +!!schemaWrapperInfo.propertySchemaObject.pattern >
105
+ +this.convertValidator(schemaWrapperInfo.propertySchemaObject.maxLength) +
106
+ +this.convertValidator(schemaWrapperInfo.propertySchemaObject.minLength) +
107
+ +this.convertValidator(schemaWrapperInfo.propertySchemaObject.maximum) +
108
+ +this.convertValidator(schemaWrapperInfo.propertySchemaObject.minimum) +
109
+ +this.convertValidator(schemaWrapperInfo.propertySchemaObject.pattern) >
110
110
  1,
111
111
  };
112
112
  };
113
+ OpenApiDocConverter.prototype.convertValidator = function (validationValue) {
114
+ var exists = validationValue !== null && validationValue !== undefined;
115
+ return +exists;
116
+ };
113
117
  OpenApiDocConverter.prototype.convertArrayObjectToValuePropertyType = function (propertyName, schemaWrapperInfo) {
114
118
  var required = this.getIsRequired(propertyName, schemaWrapperInfo);
115
119
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ts-generator",
3
- "version": "4.89.3",
3
+ "version": "4.89.5",
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",