I am working with the play framework and I would like to create a custom binder for JSON that comes from a POST method. I was trying to do that with a @Global TypeBinder, but that seems to only work for when things come as form encoded (I was digging through Binder.java and it does not seem to consider the POST body for binding and assumes that there is a name prefix in params to use for data).
Right now I am taking the approach referenced here that appears to be out of date, so I am assuming things have changed.
public class GsonBinder implements TypeBinder<JsonObject> { public Object bind(String name, Annotation[] antns, String value, Class type) throws Exception { return new JsonParser().parse(value); } }