Pass a json and get all crud apis and swagger documents. Developed based on @nestjx/crud
python > 3.7
intsall ipython
install @nest/cli
install @nestjx/crud
install @nestjs/swagger
put beg.py into your nestjs project folder
ipython beg.py entity_name.json
your_entity.json contains the structure of your entity, it looks exactly same as the json you sent to server or responsed.
For example:
test.json
{"name": "hi", "age": 1}
This json will convert to an entity file like this:
test.entity.ts
export class Test {
@PrimaryGeneratedColumn()
@ApiModelProperty()
id: number;
@Column()
@ApiModelProperty()
name: string;
@Column()
@ApiModelProperty()
age: number;
}
And automatically generate corresponding module, service, controller, Swagger documents and update app.module.
Swagger