Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenApi-Generator-Plugin - Is it possible to generate spring @Component Annotation in ApiClient when creating Webclients?

is it possible to generate my XYZClient and invoker ApiClient as Spring beans with an @Component Annotation ?

I am using the open-api-generator gradle plugin.

like image 934
Maevy Avatar asked Oct 19 '25 14:10

Maevy


1 Answers

There is an open issue about this in GitHub repo. Still, AFIAK it is possible, there is an example in the discussion thread like this:

<configOptions>
      <additionalModelTypeAnnotations>@lombok.Builder @lombok.NoArgsConstructor @lombok.AllArgsConstructor</additionalModelTypeAnnotations>
</configOptions>

It uses the lombok annotations, but it does not matter. You can specify a FQCN of spring @Component annotation or @Service annotation.

like image 112
misha2048 Avatar answered Oct 22 '25 05:10

misha2048



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!