Details
-
Type: extRequest
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Fix Version/s: Sprint 4.1.2
-
Component/s: FIWARE-TECH-HELP
-
Labels:None
-
HD-Chapter:Data
-
HD-Enabler:Orion
Description
Testing: Publish/Subscribe Broker - Orion Context Broker
Tested versions: 0.14.0 and 0.16.0
Responsible: fiware@ulpgc.es
Environment: 0.14.0 tested in VM hosted in Fiware Cloud. 0.16.0 tested in
private server.
Description
Using the pagination feature with details param enabled we get an errorCode
like:
XML version
<errorCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
<details>Count: 322</details>
</errorCode>
JSON version
"errorCode" :
We have a doubt with the details field, it seems to be a general field and
it hasn’t a specific format. The “problem” resides in that “Count” isn’t a
field. For example, if the JSON version is used by javaScript function,
get the numbers of elements is something like:
//data has the orion response
var elements =parseInt(data.errorCode.details.replace(“Count: ”.””));
If “Count” could be a property the functions would be something like:
//data has the orion response
var elements =parseInt(data.errorCode.details.Count);
The second approach may be more coherent with the JSON structure. If
details field could have more information at same time, getting the number
of elements will be harder.
Reading official documentation, actual approach seems to be the desired
behavior.
How to replicate: Use RESTful API for Orion Context Broker and make a
paginated query with “details=on”.
_______________________________________________
Fiware-lab-help mailing list
Fiware-lab-help@lists.fi-ware.org
https://lists.fi-ware.org/listinfo/fiware-lab-help
Please send the answer to this request to fiware@ulpgc.es