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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -