Strange mistake

  • 14
  • Locked
REQUIRED CONNECTED LIBRARIES: Jackson Core, Bind and Annotation 2.6.1 Running the code in the Solution class's main method results in a strange error during JSON serialization/deserialization. The sampleJsonString string should be displayed, but that's not exactly what happens.
You can't complete this task, because you're not signed in.
Comments (1)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 38 , Greenfield, USA, United States
1 October 2022, 14:01
Not that hard to solve even if you don't understand the new JSON annotations. There's an asymmetry that's pretty obvious and the intuitive fix is the correct one. The concepts here are pretty important, I think, so you don't want to stop there. Google up on JsonCreator and JsonAnySetter/JsonAnyGetter. JSonCreator is about how to initialize an object that takes arguments using a JSON string. JsonAnySetter/Getter is about how to read/write object values to or from JSON.