Symptom
When getting items e.g. product via Platformwebservices and the item contains collection which have only one element e.g. if a Product only has one Price Row, then the json representation of the collection is a JSON Object:
"europe1Prices": {
"priceRow": {
"@pk": "8796093153313",
"@uri": "http://localhost:9001/lionplatformwebservices/rest/pricerows/8796093973535"
},
"price": "120.0"
}
When the collection has more than one element then the json being returned is an array:
"europe1Prices": {
"priceRow": [
{
"@pk": "8796113110047",
"@uri": "http://localhost:9001/ws410/rest/pricerows/8796113110047"
},
{
"@pk": "8796113208351",
"@uri": "http://localhost:9001/ws410/rest/pricerows/8796113208351"
}
]
}
This is an issue if client code is expecting an array which leads to not being able to consume related data using a single e.g. JavaScript client.
Read more...
Environment
SAP hybris V4,V5
Product
Keywords
hybris, platformwebservices, json, array, collection, single, object , KBA , CEC-COM-CPS , SAP Commerce , Problem
About this page
This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.