[REQ] Enhancing generated Code by customising with YAML-Based Binding Files
Is your feature request related to a problem? Please describe.
I'm always frustrated when the generated model classes do not look the way that I would have expected.
It is the nature of code generation that this can happen, but I would like to have the ability to influence the generated output more.
E. g. Injecting additional code has been a very useful thing in the past.
Describe the solution you'd like
I think there are two ways to cover this
-
Vendor extensions inside of the YAML file
-
additional binding files [as they exist for XSD](https://docs.oracle.com/javase/tutorial/jaxb/intro/custom.html), [code injection example](https://plindenbaum.blogspot.com/2012/09/customizing-java-classes-for-ncbi.html)
While having more vendor extensions could accomplish that I think it it has disadvantages:
a. it can grow very big, especially when injecting code
b. as a client, you'll get a YAML handed over and usually don't want to modify it to simplify the workflow of updating
So because especially because of b) I would propose a separate xjc-like binding file that allows to refine the generated code. Of course we do not like XML and would prefer an YAML version of it.
Describe alternatives you've considered
- Mustace templates: these alone do not handle non-generic changes that apply to single types only very good
- Vendor extensions: These could cover my wishes too, but at the moment there is no annotation like
x-inject-codeto add more code to the generated POJO.