vandium-io / joi-json Goto Github PK
View Code? Open in Web Editor NEWBuilds Joi schemas from JSON
License: BSD 3-Clause "New" or "Revised" License
Builds Joi schemas from JSON
License: BSD 3-Clause "New" or "Revised" License
lib.stringify( joi.string().min(1).max(60).trim().required() )
// 'string:min=1,max=60,required'
Could provide above methods? or similar?
Thank you!
Suppose I have a two dates - fromDate and toDate and I don't want the toDate to be before fromDate. In joi I would refer fromDate as follows -
How can I do the same in joi-json ??
Is there support for validating the possible values of fields that come as part of a json object (whether primitive or otherwise)?
Array validation reference is given in documentation following
`{
credit_cards: {
'@items': 'string:creditCard',
max: 5
}
}`
But it is not working for top level array? How to validate that?
Talking about the if then else style conditions from joi...for example if this field is valid then the next one is required.
Support joi
implementation inside @hapi
organization.
Note this will introduce breaking changes, but this is the way forward supporting the official implementation of joi
.
As a background, I'm trying to validate start and end date, and my end date should not be less then start date. Hence the question, Is there a way to refer "startdate" field ? If I use JOI directly, it can be done as explained here.
https://github.com/hapijs/joi/blob/v8/API.md#datemaxdate
const schema = Joi.object({
from: Joi.date().required(),
to: Joi.date().min(Joi.ref('from')).required()
});
As I have build my whole platform (webportal framework) on this lib, it is not possible for me to directly use JOI syntax.
Thanks in advance.
Is it possible to get a 2.0.2? would be awesome to be able to get the regex feature in a release.
@hapi/joi has been deprecated. It has been renamed to joi.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.