Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-1467

FIWARE.Request.Tech.Data.OrionContextBroker.WrongFormatPagination

    Details

    • 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" :

      { "code" : "200", "reasonPhrase" : "OK", "details" : "Count: 322" }

      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

        Activity

        Hide
        UPRC PiraeusU Node Helpdesk added a comment -

        Please send the answer to this request to fiware@ulpgc.es

        Show
        UPRC PiraeusU Node Helpdesk added a comment - Please send the answer to this request to fiware@ulpgc.es
        Hide
        fermin Fermín Galán added a comment - - edited

        Reading official documentation, actual approach seems to be the desired behavior.

        That's correct. The second approach (using a subfield of details) is also possible considering the type format for "details" in the NGSI OMA spec. However, in the case of implementing it, we have to manage backward compability (current implementations based on parsing "Count: X" string will stop to work if we change the format).

        I'd recommend you to create an issue at https://github.com/telefonicaid/fiware-orion so we can continue discussion there (FIWARE JIRA is not a good tool for that, given that its not public).

        Show
        fermin Fermín Galán added a comment - - edited Reading official documentation, actual approach seems to be the desired behavior. That's correct. The second approach (using a subfield of details) is also possible considering the type format for "details" in the NGSI OMA spec. However, in the case of implementing it, we have to manage backward compability (current implementations based on parsing "Count: X" string will stop to work if we change the format). I'd recommend you to create an issue at https://github.com/telefonicaid/fiware-orion so we can continue discussion there (FIWARE JIRA is not a good tool for that, given that its not public).
        Hide
        pablo.fernandez Pablo Fernandez Moniz added a comment -

        Thank you for your indications Fermín,

        We already create an issue on GitHub: https://github.com/telefonicaid/fiware-orion/issues/668

        KR

        Show
        pablo.fernandez Pablo Fernandez Moniz added a comment - Thank you for your indications Fermín, We already create an issue on GitHub: https://github.com/telefonicaid/fiware-orion/issues/668 KR

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            pablo.fernandez Pablo Fernandez Moniz
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: