GithubHelp home page GithubHelp logo

ikatun / formik-class-validator Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 1.0 12 KB

Use class validator's decorators syntax to write formik's validation schema

License: Apache License 2.0

TypeScript 100.00%

formik-class-validator's People

Contributors

ikatun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

faloi

formik-class-validator's Issues

validate nested array

Hi,
how do you validate a nested array?
something like:

@ValidateNested(() => AdditionalInfoFormModel)
additionalInfo = AdditionalInfoFormModel[];

Document using with pre-existing class-validator decorated classes

It seems like I could have a model decorated with the original class-validator decorators, but this isn't quite obvious... I mean, importing them from this package instead of from class-validator makes it seem like this package is doing some modifications to them.

Does the model have to inherit from FormikValidatorBase, or is there a way to pass an arbitrary class to a function to transform it for formik?

On a related note, I'm not sure if/how field level validation would work with this, especially if the original class-validator decorators are used...

The reason I'm bringing this at all is that I want to define my validation rules once, and use them on both client and server, not write them with "class-validator" for the server, and with this for the client.

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.