Giter Site home page Giter Site logo

Comments (5)

nanov avatar nanov commented on May 29, 2024

Hi!

It is totally possible to replace the default ( probably outdated ) validator with something else. We use in production ajv.

With that being said, the validator must validate the (command) object against JSON schemas, which in my opinion is a far better option than JOI taking into account its standardisation cross-language and cross-platfrom support.

Alternatively you could implement completely custom validations in pre-load-conditions ( the validation is basically the same ) and throw validation errors as wish there.

If you decide to go with the JSON schema way, i would be more than happy to provide you with an example that uses custom validator.

from node-cqrs-domain.

blissi avatar blissi commented on May 29, 2024

@nanov I'm not limited to Joi and would highly appreciate your ajv-example.

from node-cqrs-domain.

nanov avatar nanov commented on May 29, 2024

I am on it.

from node-cqrs-domain.

nanov avatar nanov commented on May 29, 2024

Ok,

I've tried to come up with something quickly.
I will continue to update those examples when I find the time as i truly believe those are useful.

As per your specific question :

Complete AJV validation and error reporting is implemented in this example. Take a look at it and how it works, and let me know if this is helpful.

from node-cqrs-domain.

blissi avatar blissi commented on May 29, 2024

Thanks, that's definately helpful! I'll play around with it.

from node-cqrs-domain.

Related Issues (20)

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.