Skip to content

Quick script to generate the class-validator decorators that can be applied to a TypeORM entity.

License

Notifications You must be signed in to change notification settings

wendi-yu/generate-class-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate Class Validator

Script that automatically populates a TypeORM entity with the class-validator validators we use to decorate. Meant to be used with entities generated by the typeorm-model-generator script available from npm.

How to use

First clone the repo. You need some version of Python 3 installed, if it doesn't work try 3.8 because that's what I made it on :^). To set it up, run

pip install -r requirements.txt

It should be good to use now. The syntax is

py main.py path-to-input-file

and it prints the result on stdout. So to store the output in a file, you can run

py main.py path-to-input-file > path-to-desired-output-file

where the output file doesn't need to already exist. If it does, it'll be overwritten.

About

Quick script to generate the class-validator decorators that can be applied to a TypeORM entity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published