Code Monkey home page Code Monkey logo

joi-json's Issues

How to create top level array validation?

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?

new release?

Is it possible to get a 2.0.2? would be awesome to be able to get the regex feature in a release.

Support `@hapi/joi` implementation

Support joi implementation inside @hapi organization.

Note this will introduce breaking changes, but this is the way forward supporting the official implementation of joi.

Is it possible to provide REF ?

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.

How to reference a schema ?

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 -

  • fromDate: Joi.date().iso().required(),
  • toDate : Joi.date().iso().greater(Joi.ref('startTime')).required()

How can I do the same in joi-json ??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.