hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client
https://heyapi.vercel.app
Other
1k stars 83 forks source link

Add an option to modify generated type names via a builder or a suffix #960

Open MrLepage opened 3 weeks ago

MrLepage commented 3 weeks ago

Summary: I would like to request a feature that allows users to customize the names of the generated types through a builder or by adding a suffix. This enhancement would provide more flexibility and clarity, especially when integrating generated types into existing projects where specific naming conventions are required.

Use Case: In scenarios where the generated types need to adhere to particular naming conventions or to avoid naming conflicts within a project, the ability to modify the names of these types is essential. For example, adding a suffix like Dto to the generated types can help maintain consistency and improve readability.

Proposed Solution: • Introduce an option in the configuration to allow users to specify a suffix or a custom name pattern for generated types. • Provide clear documentation and examples on how to use this new feature.

Benefits: • Enhances the flexibility of type generation. • Allows better integration with projects that have strict naming conventions. • Reduces potential conflicts and confusion in large codebases.

I believe this feature would significantly improve the developer experience and extend the utility of the type generation tool. Thank you for considering this request!

mrlubos commented 3 weeks ago

@MrLepage This will be definitely supported in the future. Let me put a vote on this to see how important it is compared to other features!