Accueil‎ > ‎

Swagger CodeGen: Java Client

posted 21 May 2019, 07:34 by Christophe Noël
The Apache CXF client still knows additional issues comparing to the pure Java Client export proposed by Swagger (e.g. the request QueryParams with a Date type are not correctly supported).

A few tips may help using the pure Java client generator:
- Comment the maven-surefire-plugin config in pom.xml : it is not working as is
- Modify the base path as follow: api.getApiClient().setBasePath("http://qcmms-cat.spacebel.be");
- Set the logging interceptor as follows: 
            HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
            loggingInterceptor.setLevel(Level.BODY);
            api.getApiClient().getHttpClient().interceptors().add(loggingInterceptor);
- If you wish to use another logger (e.g. slf4j on log4j) add the dependencies:
  <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.26</version>
    </dependency>
Comments