send the _id as a string

pull/708/merge
Justin Richer 2015-02-24 15:52:29 -05:00
parent 3b6412219b
commit ad228e8953
2 changed files with 6 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.LongSerializationPolicy;
@Component(ResourceSetEntityAbbreviatedView.VIEWNAME)
public class ResourceSetEntityAbbreviatedView extends AbstractView {
@ -55,6 +56,7 @@ public class ResourceSetEntityAbbreviatedView extends AbstractView {
})
.serializeNulls()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.setLongSerializationPolicy(LongSerializationPolicy.STRING)
.create();
@Override
@ -82,7 +84,7 @@ public class ResourceSetEntityAbbreviatedView extends AbstractView {
JsonObject o = new JsonObject();
o.addProperty("_id", rs.getId());
o.addProperty("_id", rs.getId().toString()); // set the ID to a string
o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/resource/" + rs.getId());

View File

@ -25,6 +25,7 @@ import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.LongSerializationPolicy;
@Component(ResourceSetEntityView.VIEWNAME)
public class ResourceSetEntityView extends AbstractView {
@ -56,6 +57,7 @@ public class ResourceSetEntityView extends AbstractView {
})
.serializeNulls()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.setLongSerializationPolicy(LongSerializationPolicy.STRING)
.create();
@Override
@ -83,7 +85,7 @@ public class ResourceSetEntityView extends AbstractView {
JsonObject o = new JsonObject();
o.addProperty("_id", rs.getId());
o.addProperty("_id", rs.getId().toString()); // send the id as a string
o.addProperty("user_access_policy_uri", config.getIssuer() + "manage/resource/" + rs.getId());
o.addProperty("name", rs.getName());
o.addProperty("uri", rs.getUri());