From 611a0e8f820746fd1f8ab9c1c880910639959cdc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 20 Dec 2016 00:39:18 +1300 Subject: Fix issue with JSON timestamps --- src/org/traccar/api/ObjectMapperProvider.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/org/traccar/api') diff --git a/src/org/traccar/api/ObjectMapperProvider.java b/src/org/traccar/api/ObjectMapperProvider.java index c916c1f4c..0d361ea19 100644 --- a/src/org/traccar/api/ObjectMapperProvider.java +++ b/src/org/traccar/api/ObjectMapperProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package org.traccar.api; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import org.traccar.Context; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @@ -24,15 +25,9 @@ import javax.ws.rs.ext.Provider; @Provider public class ObjectMapperProvider implements ContextResolver { - private ObjectMapper mapper = new ObjectMapper(); - - public ObjectMapperProvider() { - mapper.setConfig(mapper.getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)); - } - @Override public ObjectMapper getContext(Class type) { - return mapper; + return Context.getObjectMapper(); } } -- cgit v1.2.3