Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 783 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 783 Bytes

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.