Tallysticks / Sequelize Joi
Licence: mit
Joi schema validation for Sequelize models
Stars: ✭ 13
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Sequelize Joi
Cafy
☕️ Simple, lightweight, flexible validator generator
Stars: ✭ 22 (+69.23%)
Mutual labels: validation
Ember I18n Changeset Validations
ember-i18n support for ember-changeset-validations messages
Stars: ✭ 11 (-15.38%)
Mutual labels: validation
React Express Fullstack
Full stack (mostly unopinionated) starter pack with React+Redux and Expressjs
Stars: ✭ 23 (+76.92%)
Mutual labels: sequelize
Trumail
✉️ ✅ A Fast and Free Email Verification API written in Go
Stars: ✭ 937 (+7107.69%)
Mutual labels: validation
Furion
Make .NET development easier, more versatile, and more popular.
Stars: ✭ 902 (+6838.46%)
Mutual labels: validation
Kubevious
Kubevious - application centric Kubernetes UI and continuous assurance provider
Stars: ✭ 869 (+6584.62%)
Mutual labels: validation
Validformbuilder
ValidForm Builder. Easy and safe XHTML 1.0 strict forms with validation!
Stars: ✭ 26 (+100%)
Mutual labels: validation
Structured Acceptance Test
An open format definition for static analysis tools
Stars: ✭ 10 (-23.08%)
Mutual labels: validation
Cti Stix Validator
OASIS TC Open Repository: Validator for STIX 2.0 JSON normative requirements and best practices
Stars: ✭ 24 (+84.62%)
Mutual labels: validation
Valley
Extensible schema validations and declarative syntax helpers in Python.
Stars: ✭ 25 (+92.31%)
Mutual labels: validation
Ismailfine
A simple (but correct) library for validating email addresses. Supports mail addresses as defined in rfc5322 as well as the new Internationalized Mail Address standards (rfc653x). Based on https://github.com/jstedfast/EmailValidation
Stars: ✭ 9 (-30.77%)
Mutual labels: validation
Express
Express + Sequelize + Winston + Jasmine + TypeScript + Webpack MVC Boilerplate
Stars: ✭ 9 (-30.77%)
Mutual labels: sequelize
In App Purchase
A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
Stars: ✭ 868 (+6576.92%)
Mutual labels: validation
Sequelize Joi
Allows specifying Joi validation schema for JSONB
model attributes in Sequelize.
Installation
npm install --save sequelize-joi
Usage
const Sequelize = require('sequelize')
const sequelize = new Sequelize()
const sequelizeJoi = require('sequelize-joi')
sequelizeJoi(sequelize)
Custom Joi object may be passed:
const Joi = require('joi')
const CustomJoi = Joi.extend(joi => {})
sequelizeJoi(sequelize, { Joi: CustomJoi })
Example
const SampleModel = sequelize.define('SampleModel', {
details: {
type: Sequelize.JSONB,
allowNull: false,
schema: Joi.object().keys({
requiredString: Joi.string().required(),
optionalString: Joi.string().default(null),
optionalObject: Joi.object().keys({
requiredSubNumber: Joi.number().required(),
}),
})
},
})
// Validation passes
await SampleModel
.build({
details: {
requiredString: 'One',
optionalString: 'Two',
},
})
.validate()
.then(instance => {
// instance contains default values appended by Joi
})
// Validation fails
await SampleModel
.build({
details: {
optionalString: 123,
},
})
.validate()
.catch(error => {
// error is a 'SequelizeValidationError'
// error.errors is an array of 'SequelizeValidationErrorItem'
})
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].