@restura/core 2.0.2 → 2.0.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/dist/index.js CHANGED
@@ -433,15 +433,17 @@ var ResponseValidator = class _ResponseValidator {
433
433
  );
434
434
  return { validator: "any", isOptionalOrNullable: false };
435
435
  }
436
+ const isOptionalOrNullable = isNullable || column.roles.length > 0 || column.scopes.length > 0 || column.isNullable;
437
+ const columnType = column.type.toLowerCase();
438
+ if (columnType === "json" || columnType === "jsonb") {
439
+ return { validator: "object", isOptionalOrNullable };
440
+ }
436
441
  let validator = SqlUtils.convertDatabaseTypeToTypescript(
437
442
  column.type,
438
443
  column.value
439
444
  );
440
445
  if (!_ResponseValidator.validatorIsValidString(validator)) validator = this.parseValidationEnum(validator);
441
- return {
442
- validator,
443
- isOptionalOrNullable: isNullable || column.roles.length > 0 || column.scopes.length > 0 || column.isNullable
444
- };
446
+ return { validator, isOptionalOrNullable };
445
447
  }
446
448
  parseValidationEnum(validator) {
447
449
  let terms = validator.split("|");