Tom Carchrae
Tom Carchrae

Reputation: 6476

How to serialze a map in RestyGWT

I want to send a Map<String,Object> to a server using RestyGWT. However, when I serialize a map in the request it adds extra quote escapes around the string keys.

So,

map.put("hello",123);
service.sendRequest(map,callback);

results in JSON being sent of

{"\"hello\"":123}

instead of the desired result

{"hello":123}

Here is the RestyGWT interface:

@POST
@Path("/data")
public void setRequest(Map<String, Object> map, JsonCallback callback);

Upvotes: 1

Views: 679

Answers (1)

Tom Carchrae
Tom Carchrae

Reputation: 6476

This behaviour was a bug. It has been fixed in the latest source version, so v1.4 onwards should not see this issue.

Upvotes: 2

Related Questions