When I serialize
public class FOO {
int field1;
String field2;
}
I got the following.
{"FOO":{"field1":0,"field2":"value"}}
Can you point me how can I make the output look like this
{"field1":0,"field2":"value"}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve figured out how to make it. Actually the problem is that MappingJacksonJsonView has a map So that’s why it returns it that way
{"FOO":{"field1":0,"field2":"value"}}But If I configured it that way
It will serialize the object itself not the whole map. I hope it will help someone else.