This probably won't work right away, so maybe you should think about other solutions, such as finding an additional library to handle this.
The game uses Jackson. In Java, you can use the Jackson annotation org.codehaus.jackson.annotate.JsonProperty in your properties to set names manually. The argument for the value parameter will be used as the key name.
@JsonProperty("user_name") String userName;
I do not know if this works on Play using Scala. Based on the comments in this thread about Scala and Jackson , the deserialization syntax should be something like this:
class User @JsonCreator()( @JsonProperty("user_id") val userId:Long, @JsonProperty("user_name") val userName:String )
You can find another example of Jackson annotations in the case class in this question .
Kapep
source share