Java libraries supported - ronreynolds/openapi-generator GitHub Wiki

the JavaClientCodegen class of the openapi-generator project currently (2025-02-15) supports the use of 15 different HTTP-handling libraries, some that require a specific JSON-processing library and some that don't. a few other Java client libraries are supported by entirely different Codegen classes (JavaCXFClient, JavaHelidonClient, JavaHelidonCommon, JavaMicronaut (now deprecated), etc) which are beyond the scope of this wiki for now.

the purpose of this wiki is to document the basics of the libraries supported by JavaClientCodegen and to start to plan a way to make them more consistent with each other. all of this is based on the code (mustache files and generated sample java) and not the published docs. the number of mustache files for a specific library seems a reasonable start for a complexity metric.

The libraries

based on:

  • modules/openapi-generator/src/main/resources/Java/libraries
  • org.openapitools.codegen.languages.AbstractJavaCodegen
  • org.openapitools.codegen.languages.JavaClientCodegen
HTTP library JSON library options Notes
apache-httpclient Jackson 7 mustaches; ApiClient extends JavaTimeFormatter
feign GSON or Jackson 14 mustaches + auth and model dir; no JavaTimeFormatter
google-api-client Jackson 6 mustaches; no JavaTimeFormatter
jersey2 Jackson 20 mustaches + auth dir; ApiClient extends JavaTimeFormatter
jersey3 Jackson 21 mustaches + auth dir; ApiClient extends JavaTimeFormatter
microprofile Jackson or JSON-B 35 mustaches; no ApiClient at all
native GSON or Jackson (tho only Jackson is listed in pom) Java-11+; 23 mustaches; no JavaTimeFormatter
okhttp-gson GSON 24 mustaches + auth dir; no JavaTimeFormatter
rest-assured GSON or Jackson Java-8 only; 12 mustaches; no JavaTimeFormatter
restclient Jackson 6 mustaches + auth dir; ApiClient extends JavaTimeFormatter
resteasy Jackson 6 mustaches; ApiClient extends JavaTimeFormatter
resttemplate Jackson 9 mustaches; ApiClient extends JavaTimeFormatter
retrofit2 GSON or Jackson (play24/25/26 seem to dictate Jackson) 15 mustaches + auth, play24, play25, play26, play-common.auth dir; no JavaTimeFormatter
vertx Jackson 9 mustaches + auth dir; ApiClient extends JavaTimeFormatter
webclient Jackson 8 mustaches + auth dir; ApiClient extends JavaTimeFormatter