Is there already have this function?
Thanks
Well we do not rely on @lombok in our codebase (and personally I would not like to add it), but I guess you are generating some code (could you indicate which generator name you are using?) and you would like to use lombok in your generated project?
Thanks @jmini,
I am using command "spring" to generate model code. e.g
openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -o /tmp/test/
And I want the models for example “Pet” have default builders. Normally I will add the "@Builder"
e.g now:

expected:

Thanks
As I told, there is no lombok support right now...
You can still add the annotations to the generated project after code generation (see the guides project lombok website) and edit the generated files.
If you want to generate code with this annotation already in place, you will need to modify the templates. You can do this: just for you locally, or try to contribute it back to the project (then you will need to add an option, because this is not something everybody wants in its project).
Our customization doc is a good starting point. Do not hesitate to continue the discussion if you need more information.
I think it would be good to have a way to add custom annotations while generating the models
Other than Lombok other use-cases would adding JPA annotations like @Entity or @Table
Being able to do this via the configuration file would really be ideal
I did make a custom template set that allows you to optionally use Lombok for your models and to optionally include Actuator. You can find these here:
https://github.com/deviantlycan/openapi-generator-templates/tree/master/generator-templates/JavaSpring/spring-boot-lombok-actuator
This may be a good inclusion to a new release, but I did not want to assume that something like this is on the roadmap.
Thanks to this PR you can now use Additional annotations for model type like lombok in 4.2.3 release.
Most helpful comment
I think it would be good to have a way to add custom annotations while generating the models
Other than Lombok other use-cases would adding JPA annotations like
@Entityor@TableBeing able to do this via the configuration file would really be ideal