Using a playback platform.
controller
@BodyParser.Of(BodyParser.Json.class) public static Result getResponseJson(Long id){ List<DataField> entities = new Model.Finder<>(Long.class, DataField.class) .where("response_id = " + id).findList(); Response response = new Response(entities, id); return ok(toJson(response)); }
Response Object:
public class Response { private Long uuid; private Map<TableField, String> map = new HashMap<>(); ...constructors, getters and setters... }
I am checking the response using POSTMAN. On the "Raw" tab, I got:
{"uuid":3942015886343226874,"map":{"Work":"Contract","locale":"Mogilev"}}
On the "Pretty" tab:
{ "uuid": 3942015886343227000, "map": { "Work": "Contract", "locale": "Mogilev" } }
Why is uuid rounded up?
source share