typeorm-schema-to-json-schema
Typeorm entitySchema to json schema.
Install
npm install typeorm-schema-to-json-schema
Get started
-
Cat model
const EntitySchema =const Cat =name: 'cats'columns:id:type: Numberprimary: truegenerated: truename:type: Stringmoduleexports = Cat -
convert model
const convert = const Cat = const schema = console // {// type: 'object',// properties: {// id: { type: 'number', primary: true, generated: true },// name: { type: 'string' }// }// }