swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

duplicate imports on generated models in typescript-axios exported files

Open ali-arjmandi opened this issue 8 months ago • 4 comments

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Swagger/OpenAPI version: OpenAPI 3.0

Hi, I'm trying to export my swagger JSON as typescript-axios. I exported my JSON 2 months ago and there were no problem. now I want to export it again. but this time in the models directory, inside ts files, the classes are imported twice. It's cause typescript errors.

as example: import { AccountContractDto } from './account-contract-dto'; import { AccountContractDto, } from ".";

ali-arjmandi avatar Dec 03 '23 17:12 ali-arjmandi

I am having the same issue. swagger-codegen version 3.0.50 does not have the issue, but I am receiving these errors with 3.0.51. import { SubscriptionDetailsDto } from './subscription-details-dto'; import { SubscriptionDetailsDto, } from ".";

crichardson05 avatar Dec 08 '23 23:12 crichardson05

Same for me, I'm getting duplicate imports on generated models in typescript.

42geek avatar Dec 19 '23 09:12 42geek

I also encountered the same problem and it was very annoying. I had to delete it manually every time. It seems that the model was imported twice. image

Net-18K avatar Dec 19 '23 09:12 Net-18K

could be related to https://github.com/swagger-api/swagger-codegen/issues/12300

fmockers avatar Dec 26 '23 15:12 fmockers