2

I need the String property of object to be serialized as nested JSON without any escaping etc. So given json:

{
  "regularProperty" : "Test here",
  "nestedJSON" : {
    "propertyArray" : [1,2,3],
    "propertyText" : "new Text",
    "anotherObject" : { ... }
  }
}

And the nestedJSON property must contain the text

{
  "propertyArray" : [1,2,3],
  "propertyText" : "new Text",
  "anotherObject" : { ... }
}

How is it possible for both serialization/deserialization? Any specific annnotation or data type?

1 Answer 1

4

Maybe add the annotation JsonRawValue on the nestedJSON field? I never used it before but it seems quite promising for your case.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.