cjbooms / fabrikt

Generates Kotlin Code from OpenApi3 Specifications
Apache License 2.0
157 stars 41 forks source link

Allow custom suffix for model classes #318

Closed shanio closed 1 month ago

shanio commented 1 month ago

Specifying a suffix for generated model classes would be beneficial to distinguish it from domain model classes, that are usually suffix/prefix free. We typically use something like Dto or Api.

Would it be possible to add this configuration option? OpenApi generator for kotlin allows this option, named as apiSuffix: https://openapi-generator.tech/docs/generators/kotlin/

cjbooms commented 1 month ago

Should be easy enough to add. If you are willing to make the contribution, I'll prioritize getting it merged and released.

shanio commented 1 month ago

Sure, I'll create a PR. Any remarks regarding the name of the parameter and it's placement? So far I've thought about creating a --model-suffix argument on top-level.

cjbooms commented 1 month ago

I'm not sure why the other options have --http- as the prefix, but maybe stick with convention so it is sorted alongside the --http-model-opts when the usage table is generated

shanio commented 1 month ago

I've prepared a PR, that adds this functionality. If you can prioritize it, it will be great.