Skip to Content
0
Apr 27, 2015 at 05:40 AM

how to remove key with null value storefront ajax response?

205 Views

Hi,

I have a question about returning data in storefront extension with Ajax, the below snippet should return a particular product data, but if I did not populate some attributes say ProductReferenceData, it will show in the response with null, my question is can it be removed?

As I can observe, there is no such problem in webservices extesnion (I am using v1), is it some setting of marshaller in Spring web?

@RequestMapping(value = "/ajax", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ProductData getProductData()
{
..
return productData;
}

Thanks.