希望有人可以提供帮助。Product我正在尝试反序列化从 Prestashop 1.7 的 web 服务中获取的类的 JSON 数组,使用和这样的 url http://myshop.com/api/products/?display=full&filter[reference]=[0003]&output_format=JSON。JSON输出是这样的
{
"products": [{
"id": 1,
"id_manufacturer": "0",
"id_supplier": "0",
"id_category_default": "2",
"new": null,
"cache_default_attribute": "0",
"id_default_image": "",
"id_default_combination": 0,
"id_tax_rules_group": "3",
"position_in_category": "0",
"manufacturer_name": false,
"quantity": "0"
},
{
"id": 2,
"id_manufacturer": "0",
"id_supplier": "0",
"id_category_default": "2",
"new": null,
"cache_default_attribute": "0",
"id_default_image": "",
"id_default_combination": 0,
"id_tax_rules_group": "3",
"position_in_category": "0",
"manufacturer_name": false,
"quantity": "0"
}
]
}
该类Products只是List类Product定义中的一个,如下所示:
public class Products {
private List <Product> products;
public Products() {
super();
}
public List<Product> getProducts(){
return this.products;
}
public void setProducts(List<Product> products){
this.products = products;
}
}
噜噜哒
千万里不及你
相关分类