openapi-typescript-codegen
openapi-typescript-codegen copied to clipboard
Adding model suffix option
Hello, great project, thanks! Have you considered adding an option for setting up the suffix for generated model classes inside models folder? I have a lot of conflicting names in my codebase after generating the sdk from openapi schema - e.g. my custom Offer class and then generated Offer model class. I was thinking of create my own file where I will re-export these model classes with the suffix (e.g. OfferModel), but it seems to my a bit unfortunate to maintain, etc. so that is why I am asking about that. Thanks for answer!
Yes!! I would like to suffix with all generated "models" with DTO and later implement my own "model".
e.g. CustomerDTO -> new Class Customer with a constructor like this constructor(customer: CustomerDTO).
Yeah, this feature would be great. I have a similar problem with the ApiError generated in core and a model generated with the same name. Currently I'm just renaming the ApiError from core to ApiErrorCore in index.ts but being able to add a suffix like "Dto" to all models would fix this in a very clean way 👍