MariusAlch/json-to-ts

possible to add generate entity for typeorm?

Closed this issue · 2 comments

I need to convert JSON data in typeORM entity.
Can you add this function to your library?

IMO, this is outside of the scope of this library as TypeORM entities are not types, but rather classes with specual decorators.

What you probably should do is generate an interface with this library, and then use it as implements.

class SomeEntity extends Entity implements InterfaceGeneratedByThisLibrary {
  foo: number
  bar: string
}

I agree. Converting JSON to typeorm entity is an entirely different thing compared to what is lib suppose to do.