Jersey: Json array with 1 element is serialized as object

前端 未结 8 2124
眼角桃花
眼角桃花 2021-01-03 19:20

I\'m creating a REST server with Jersey/Java and I found a strange behavior.

I have a method on the server that returns an array of objects as Json

@         


        
8条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-03 20:05

    I'm using cxf, here is my applicationContext.xml to force array in JSON:

    
    
        
    
    
        
       
       
       
          
            
          
       
       
          
        fileInfo
          
                                 
        
    
    
    

提交回复
热议问题