1

I am using Hateoas in my project and it works well.

But Jackson works unexpectedly. I always getting additional fields "content" and "links" when I call objectMapper.writeValueAsString().

For example I have a class that has only the fields "pattern" and "keyword"

public class AutoFillAssistantWord {
      Pattern pattern;
      String keyword;
}

But I get the result when the object of AutoFillAssistantWord is serialized to json.

   {
         "pattern" : null,
         "keyword" : null,
         "content" : [ ],
         "links" : [ ]
   }

I find the fields are added by some hateoas methods while debuging the serialized process. Look at the screenshot below:

enter image description here

Anyone please suggest how to avoid the additional fields on json.

rohanagarwal
  • 771
  • 9
  • 30
Wenyuan Chen
  • 115
  • 1
  • 10

0 Answers0