JAX-RS marshall/unmarshall JSON array without root object -


i have following class.

public class observations {     public string[] observations; } 

which have annotated consume/produce xml , json using jax-rs webservice. i'm using jackson.

public class observations {     @xmlelement(name="observation")     @jsonproperty("observations")     public string[] observations; } 

the issue i'm getting following output when serializing class:

{     "observations": [         "one", "two"     ] } 

and want or provide:

["one", "two"] 

what should in annotation want?

ta


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -