jackson change field name when convert java object to json

8 views
Skip to first unread message

Phil Zhang

unread,
Jan 19, 2020, 7:26:21 PM1/19/20
to jackson-user
I met a strange issue, I have a class and it has two usernames, so I call them aName and bName, such as:

public class Member{
    private String aName;
    private String bName;
}

But when jackson convert this to a json response, it will change field name to aname and bname, is this a feature or can I avoid this by configuration?

Tatu Saloranta

unread,
Jan 19, 2020, 7:35:31 PM1/19/20
to jackson-user
What exactly are you doing? Please show the code, including configuration of ObjectMapper (and full class declaration). Class definition alone does not really show what is happening unfortunately.

-+ Tatu +- 
 
Reply all
Reply to author
Forward
0 new messages