Replies: 1 comment
-
Our general thinking is that when customization of generated types is necessary, you're probably better off creating your own types instead of relying on code gen. It's very common to have multiple Java classes represent the same "thing", but with different concerns:
It's tempting to want to re-use the same (generated) class for all these concerns, because they're mostly the same. This leads to mixing concerns that shouldn't be mixed, and making compromises in, for example, what fields are exposed. The reason is that such customizations, even if they seem simple, very quickly get out of hand. This makes both CodeGen more complicated and makes your code base harder to reason about. For your specific case, |
Beta Was this translation helpful? Give feedback.
-
Hi, what do you think about the idea of adding to the generator the ability to place annotations over a class, for example I would like to add the @FieldNameConstants annotation. There is similar functionality in OpenAPI Generator
Beta Was this translation helpful? Give feedback.
All reactions