Simple request and response body converter for retrofit2
(https://github.com/square/retrofit) via fastjson
(https://github.com/alibaba/fastjson)
<dependency>
<groupId>cn.deathdealer</groupId>
<artifactId>converter-fastjson</artifactId>
<version>0.0.1</version>
</dependency>
Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.github.com") .addConverterFactory(FastjsonConverterFactory.create()) .client(new OkHttpClient()) .build();
or
FastJsonConfig fastjsonConfig = new FastJsonConfig(); Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.github.com") .addConverterFactory(FastjsonConverterFactory.create().config(fastjsonConfig)) .client(new OkHttpClient()) .build();
- fastjosn version 1.2.x or above
- retrofit version 2.x or above