Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lb4 openapi doesn't work with openapi specs generated by loopback itself #9328

Open
aaqilniz opened this issue Mar 8, 2023 · 1 comment · May be fixed by #10350
Open

lb4 openapi doesn't work with openapi specs generated by loopback itself #9328

aaqilniz opened this issue Mar 8, 2023 · 1 comment · May be fixed by #10350

Comments

@aaqilniz
Copy link
Contributor

aaqilniz commented Mar 8, 2023

Describe the bug

The lb4 openapi command fails to generate working code in case the specification provided is generated by loopback itself. This shouldn't be the case as the specification is generated by LoopBack and the framework uses that same spec.

To reproduce this, generate specs from any lb4-based project. Then use that same specification to generate openapi artifacts with lb4 openapi. The resulting app creates buggy code.

The reproduction app is built based on openapi specs of this application.

Logs

src/models/index.ts:2:1 - error TS2308: Module './account-with-relations.model' has already exported a member named 'AccountWithRelations'. Consider explicitly re-exporting to resolve the ambiguity.

2 export * from './account.model';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/models/index.ts:6:1 - error TS2308: Module './customer-with-relations.model' has already exported a member named 'CustomerWithRelations'. Consider explicitly re-exporting to resolve the ambiguity.

6 export * from './customer.model';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Additional information

I tried removing duplicate entries which have been causing the problems. The resulting code still was not working and causing another issue. The request passed to swagger-client had filter=undefined in the URL which was making swagger-client fail to fetch any data.

Reproduction

https://github.com/aaqilniz/lb4-ex-openapi

@aaqilniz aaqilniz added the bug label Mar 8, 2023
@aaqilniz
Copy link
Contributor Author

Hi @samarpanB. Can you please provide me with some guidance about this issue?

@aaqilniz aaqilniz linked a pull request Feb 7, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants