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

[fiware-stackoverflow] Non-Primitive Values from a Registered Content Provider are not showing a value

    Details

      Description

      Created question in FIWARE Q/A platform on 20-04-2018 at 17:04
      Please, ANSWER this question AT https://stackoverflow.com/questions/49945250/non-primitive-values-from-a-registered-content-provider-are-not-showing-a-value

      Question:
      Non-Primitive Values from a Registered Content Provider are not showing a value

      Description:
      I'm using the /v2/registrations endpoint to register a content provider with the legacyForwarding flag being set. Therefore my Content Provider is offering the v1/queryContext endpoint

      When I am returning a simple value (Integer, String etc.) such as a temperature the data is added to the context correctly:

      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "temperature", "type": "Number", "value": 27 }

      ],
      "id": "urn:ngsi-ld:Store:001",
      "isPattern": "false",
      "type": "Store"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      However when trying to return an array of strings as shown from a Context Provider.

      {
      "contextResponses": [
      {
      "contextElement": {
      "attributes": [

      { "name": "tweets", "type": "Array", "value": [ "String 1", "String 2" ] }

      ],
      "id": "urn:ngsi-ld:Store:002",
      "isPattern": "false",
      "type": "Store"
      },
      "statusCode":

      { "code": "200", "reasonPhrase": "OK" }

      }
      ]
      }

      I can see the request being sent in the log and I can retrieve the following entity:

      {
      "id": "urn:ngsi-ld:Store:002",
      "type": "Store",
      "address": {
      "type": "PostalAddress",
      "value": "",
      "metadata": {}
      },
      "location": {
      "type": "geo:json",
      "value": "",
      "metadata": {}
      },
      "name": {
      "type": "Text",
      "value": "Checkpoint Markt",
      "metadata": {}
      },
      "tweets": {
      "type": "Array",
      "value": "",
      "metadata": {}
      }
      }

      As you can see the "tweets" value is blank, but the attribute exists and the type has been successfully received.

      My question is how should I return an Array or an Object as a value from a Content Provider so that Orion is able to display the data received correctly?

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 20-04-2018 at 17:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/49945250/non-primitive-values-from-a-registered-content-provider-are-not-showing-a-value


        +Question:+
        Non-Primitive Values from a Registered Content Provider are not showing a value

        +Description:+
        I'm using the /v2/registrations endpoint to register a content provider with the legacyForwarding flag being set. Therefore my Content Provider is offering the v1/queryContext endpoint

        When I am returning a simple value (Integer, String etc.) such as a temperature the data is added to the context correctly:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "Number",
                                "value": 27
                            }
                        ],
                        "id": "urn:ngsi-ld:Store:001",
                        "isPattern": "false",
                        "type": "Store"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        However when trying to return an array of strings as shown from a Context Provider.

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "tweets",
                                "type": "Array",
                                "value": [
                                    "String 1",
                                    "String 2"
                                ]
                            }
                        ],
                        "id": "urn:ngsi-ld:Store:002",
                        "isPattern": "false",
                        "type": "Store"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        I can see the request being sent in the log and I can retrieve the following entity:

        {
            "id": "urn:ngsi-ld:Store:002",
            "type": "Store",
            "address": {
                "type": "PostalAddress",
                "value": "",
                "metadata": {}
            },
            "location": {
                "type": "geo:json",
                "value": "",
                "metadata": {}
            },
            "name": {
                "type": "Text",
                "value": "Checkpoint Markt",
                "metadata": {}
            },
            "tweets": {
                "type": "Array",
                "value": "",
                "metadata": {}
            }
        }


        As you can see the "tweets" value is blank, but the attribute exists and the type has been successfully received.

        My question is how should I return an Array or an Object as a value from a Content Provider so that Orion is able to display the data received correctly?
        Created question in FIWARE Q/A platform on 20-04-2018 at 17:04
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/49945250/non-primitive-values-from-a-registered-content-provider-are-not-showing-a-value


        +Question:+
        Non-Primitive Values from a Registered Content Provider are not showing a value

        +Description:+
        I'm using the /v2/registrations endpoint to register a content provider with the legacyForwarding flag being set. Therefore my Content Provider is offering the v1/queryContext endpoint

        When I am returning a simple value (Integer, String etc.) such as a temperature the data is added to the context correctly:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "temperature",
                                "type": "Number",
                                "value": 27
                            }
                        ],
                        "id": "urn:ngsi-ld:Store:001",
                        "isPattern": "false",
                        "type": "Store"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        However when trying to return an array of strings as shown from a Context Provider.

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "tweets",
                                "type": "Array",
                                "value": [
                                    "String 1",
                                    "String 2"
                                ]
                            }
                        ],
                        "id": "urn:ngsi-ld:Store:002",
                        "isPattern": "false",
                        "type": "Store"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        I can see the request being sent in the log and I can retrieve the following entity:

        {
            "id": "urn:ngsi-ld:Store:002",
            "type": "Store",
            "address": {
                "type": "PostalAddress",
                "value": "",
                "metadata": {}
            },
            "location": {
                "type": "geo:json",
                "value": "",
                "metadata": {}
            },
            "name": {
                "type": "Text",
                "value": "Checkpoint Markt",
                "metadata": {}
            },
            "tweets": {
                "type": "Array",
                "value": "",
                "metadata": {}
            }
        }


        As you can see the "tweets" value is blank, but the attribute exists and the type has been successfully received.

        My question is how should I return an Array or an Object as a value from a Content Provider so that Orion is able to display the data received correctly?
        jason.fox Jason Fox made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        jason.fox Jason Fox made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jason.fox Jason Fox made changes -
        Link This issue relates to DATA-2084 [ DATA-2084 ]
        veronika Veronika Vlnkova made changes -
        Assignee Jose Manuel Cantera [ jmcantera ] Jason Fox [ jason.fox ]
        veronika Veronika Vlnkova made changes -
        Assignee Jose Manuel Cantera [ jmcantera ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: