java - Serlaize case class with the variable inside it in scala with jackson -


i tiring serialize case class using jackson fasterxml, can see constructor parameters after deserialize (taskrequest , tasknamein) not variables inside class (jobsrequests null example):

//@jsonignoreproperties(ignoreunknown = true) // tried remove no luck @jsonautodetect case class job(taskrequest: list[taskrequest] = nil,tasknamein:string) { { this.jobsrequests = taskrequest     this.taskname= tasknamein } @jsonproperty @volatile private var jobsrequests: list[taskrequest] = nil   @jsonproperty var task_name: string = ""  } 

any suggestions ?

jackson uses getter java beans standard construct json. try adding @beanproperty properties , constructor parameters compile class getter/setters.

example

or use jackson scala-module. can take @ tests see how use module serialization.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -