@techntools/sequelize-to-openapi
Version:
OpenAPI 3 schemas from Sequelize models
21 lines • 662 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class AttributeValidator {
map(properties, strategy) {
if (!properties.validate)
return;
let result = {};
let attributeType = properties && properties.type && properties.type['key'];
switch (attributeType) {
case 'INTEGER':
case 'STRING':
result = strategy.getPropertiesForValidate(properties.validate);
break;
default:
break;
}
return result;
}
}
exports.default = AttributeValidator;
//# sourceMappingURL=attribute-validator.js.map