java - Support Jackson @JsonFilter async DeferredResult -


base on jira

i have method:

val innerresult: deferredresult[object] = new deferredresult[object]()  override def setresult(result: t): boolean = {   val beanpropertyfilter: simplebeanpropertyfilter = filter.size match {     case 0 => simplebeanpropertyfilter.serializeall()     case _ => simplebeanpropertyfilter.filteroutallexcept("id")   }    val filterprovider = new simplefilterprovider()                         .addfilter("propertiesfilter", beanpropertyfilter)    val wrapper = new mappingjacksonvalue(result)   wrapper.setfilters(filterprovider)   innerresult.setresult(wrapper) } 

in response see this:

{"headers":{}, "body":[{"id":"573080b50ccded33e08da678"}], "statuscode":"ok"} 

while want see:

[{"id":"573080b50ccded33e08da678"}] 

what doing wrong?

i don't know scala , have trouble following code (where result defined?). perhaps add method declaration , fix indentation?

in case, seem json representation of whole response instead of response body. in java, responseentity class has following attributes:

  • headers: response headers (cache-control, etc.)
  • statuscode: response status (200 ok, 404 not found, etc.)
  • body: response body (an array single object id field in case)

this part seems fishy:

val wrapper = new mappingjacksonvalue(result) innerresult.setresult(wrapper) 

it looks you're taking result (body, header, statuscode) , storing in innerresult. based solely on variable names, seems backwards.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -