After running the lb4 openapi command, models are created. However, there is no index.ts file in the models folder. If I generate the repository for the model, it will get an error during build:
src/repositories/pet.repository.ts:2:33 - error TS2307: Cannot find module '../models'.
2 import {Pet, PetRelations} from '../models';
~~~~~~~~~~~
It's not a big issue because I can create the index.ts, but generating the index.ts when generating the models would be helpful.
Steps to reproduce
- In a LB application, run
lb4 openapi https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml
- It creates the Pet and NewPet and Error model.
- Create datasource and Repository
- Run
npm run build.
It gives the error I've shown above because of the missing index.ts to export the models.
UPDATED: it also complained about PetRelations not imported in the repository class but it actually doesn't exist.
Acceptance Criteria
After running the
lb4 openapicommand, models are created. However, there is noindex.tsfile in themodelsfolder. If I generate the repository for the model, it will get an error during build:It's not a big issue because I can create the index.ts, but generating the index.ts when generating the models would be helpful.
Steps to reproduce
npm run build.It gives the error I've shown above because of the missing index.ts to export the models.
UPDATED: it also complained about
PetRelationsnot imported in the repository class but it actually doesn't exist.Acceptance Criteria
lb4 openapi{ModelName}Relations)