Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Done
-
Istanbul Release
-
None
Description
REASON: We use GSON.fromJson() to parse the JSON data received from DB into a DataNode Object. It is unable to parse Integers and defaults all numerical data to Double Objects.
YANG | cps-cavsta-onap-internal@2021-01-28.yang |
Data Space | E2EDemo |
Schema Set in CPS/Model in TBDMT based query | ran-coverage-area |
Anchor | coverage-area-onap |
Top Parent Node | ran-coverage-area |
Data Node | cavsta-data.json |
Attached are YANG file and associated JSON payload used for testing.
Node is created in CPS-Core using, POST http://localhost:8883/cps/api/v1/dataspaces/E2EDemo/anchors/coverage-area-onap/nodes
When following query is performed,
following result is obtained, and not sure why "decimal point and 0" are included in the value (most probably as String?)
[
{
"xpath": "/ran-coverage-area",
"leaves": {},
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']",
"leaves":
,
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']",
"leaves":
,
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='202']",
"leaves":
,
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='202']/taCellsList[@cellLocalId='15155']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='202']/taCellsList[@cellLocalId='15176']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='202']/taCellsList[@cellLocalId='15174']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='202']/taCellsList[@cellLocalId='15175']",
"leaves":
,
"childDataNodes": []
}
]
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='101']",
"leaves":
,
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='101']/taCellsList[@cellLocalId='15296']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='101']/taCellsList[@cellLocalId='15290']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='101']/taCellsList[@cellLocalId='15289']",
"leaves":
,
"childDataNodes": []
}
]
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='303']",
"leaves":
,
"childDataNodes": [
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='303']/taCellsList[@cellLocalId='15826']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='303']/taCellsList[@cellLocalId='15825']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='303']/taCellsList[@cellLocalId='13999']",
"leaves":
,
"childDataNodes": []
},
{
"xpath": "/ran-coverage-area/pLMNIdList[@mcc='310' and @mnc='410']/coverage-area[@coverageArea='Chennai']/coverageAreaTAList[@nRTAC='303']/taCellsList[@cellLocalId='14000']",
"leaves":
,
"childDataNodes": []
}
]
}
]
}
]
}
]
}
]
The below XPATH query works
sandeepos@sandeepos-Gazelle:~/NetworkSlicing/configDB/CPS/gerrit/Aug2021/common-cps-and-tbdmt/common$ curl -g -H "Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=" --request GET 'http://localhost:8883/cps/api/v1/dataspaces/E2EDemo/anchors/coverage-area-onap/node?xpath=/ran-coverage-area/pLMNIdList[@mcc=%27310%27%20and%20@mnc=%27410%27]/coverage-area[@coverageArea=%27Chennai%27]/coverageAreaTAList[@nRTAC=%27101%27]&include-descendants=true'
{"nRTAC":101.0,"taCellsList":[
{"cellLocalId":15296.0},{"cellLocalId":15289.0},{"cellLocalId":15290.0}]}
However - please advise why above values have decimal point and 0 included?
Thanks!