forked from loafle/openapi-generator-original
Merge pull request #739 from tomtit/revert726
Reverted JsonUtil.mustache for JavaClientCodegen after PR #726.
This commit is contained in:
commit
75ff9089af
@ -1,17 +1,23 @@
|
|||||||
package {{invokerPackage}};
|
package {{invokerPackage}};
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.fasterxml.jackson.annotation.*;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.fasterxml.jackson.databind.*;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator.Feature;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.datatype.joda.*;
|
||||||
|
|
||||||
public class JsonUtil {
|
public class JsonUtil {
|
||||||
public static GsonBuilder gsonBuilder;
|
public static ObjectMapper mapper;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
gsonBuilder = new GsonBuilder();
|
mapper = new ObjectMapper();
|
||||||
gsonBuilder.serializeNulls();
|
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
}
|
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||||
|
mapper.registerModule(new JodaModule());
|
||||||
|
}
|
||||||
|
|
||||||
public static Gson getGson() {
|
public static ObjectMapper getJsonMapper() {
|
||||||
return gsonBuilder.create();
|
return mapper;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user