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

[fiware-stackoverflow] Can't use parenthesis ( ) in an entity's attribute value

    Details

      Description

      Created question in FIWARE Q/A platform on 19-11-2015 at 12:11
      Please, ANSWER this question AT https://stackoverflow.com/questions/33803291/cant-use-parenthesis-in-an-entitys-attribute-value

      Question:
      Can't use parenthesis ( ) in an entity's attribute value

      Description:
      I've been experimenting with Orion the last few days and and after a while I made it work the way I intended to.

      I am facing an unexpected annoyance though, where a string attribute for a given entity context will fail to register.

      Example:

      http POST [my_orion_server_url]:1026/v1/updateContext < create_push.json

      Where create_push.json is:

      {
      "contextElements": [
      {
      "type": "Push",
      "isPattern": "false",
      "id": "Push1",
      "attributes": [

      { "name": "message", "type": "string", "value": "this is a test)" }

      ]
      }
      ],
      "updateAction": "APPEND"
      }

      The server replies with:

      HTTP/1.1 200 OK
      Content-Length: 129
      Content-Type: application/json
      Date: Thu, 19 Nov 2015 11:47:03 GMT

      {
      "errorCode":

      { "code": "400", "details": "Illegal value for JSON field", "reasonPhrase": "Bad Request" }

      }

      If, on the other hand, I remove the parenthesis, everything works as expected:

      json file:

      {
      "contextElements": [
      {
      "type": "Push",
      "isPattern": "false",
      "id": "Push1",
      "attributes": [

      { "name": "message", "type": "string", "value": "this is a test" }

      ]
      }
      ],
      "updateAction": "APPEND"
      }

      Server response:

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

      { "name": "message", "type": "string", "value": "" }

      ],
      "id": "Push1",
      "isPattern": "false",
      "type": "Push"
      },
      "statusCode":

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

      }
      ]
      }

      Is this intended or a bug?

      I can overcome the issue coding the parenthesis with something else and then decoding on reception, but being able to send a parenthesis straight with the entity would be way smoother and less annoying.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 54m 1 Backlog Manager 22/May/17 6:10 PM
        In Progress In Progress Closed Closed
        3h 1 Backlog Manager 22/May/17 9:10 PM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 19-11-2015 at 12:11
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/33803291/cant-use-parenthesis-in-an-entitys-attribute-value


        +Question:+
        Can&#39;t use parenthesis ( ) in an entity&#39;s attribute value

        +Description:+
        I've been experimenting with Orion the last few days and and after a while I made it work the way I intended to.

        I am facing an unexpected annoyance though, where a string attribute for a given entity context will fail to register.

        Example:

        http POST [my_orion_server_url]:1026/v1/updateContext &lt; create_push.json


        Where create_push.json is:

        {
            "contextElements": [
                {
                    "type": "Push",
                    "isPattern": "false",
                    "id": "Push1",
                    "attributes": [
                        {
                            "name": "message",
                            "type": "string",
                            "value": "this is a test)"
                        }
                    ]
                }
            ],
            "updateAction": "APPEND"
        }


        The server replies with:

        HTTP/1.1 200 OK
        Content-Length: 129
        Content-Type: application/json
        Date: Thu, 19 Nov 2015 11:47:03 GMT

        {
            "errorCode": {
                "code": "400",
                "details": "Illegal value for JSON field",
                "reasonPhrase": "Bad Request"
            }
        }


        If, on the other hand, I remove the parenthesis, everything works as expected:

        json file:

        {
            "contextElements": [
                {
                    "type": "Push",
                    "isPattern": "false",
                    "id": "Push1",
                    "attributes": [
                        {
                            "name": "message",
                            "type": "string",
                            "value": "this is a test"
                        }
                    ]
                }
            ],
            "updateAction": "APPEND"
        }


        Server response:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "message",
                                "type": "string",
                                "value": ""
                            }
                        ],
                        "id": "Push1",
                        "isPattern": "false",
                        "type": "Push"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Is this intended or a bug?

        I can overcome the issue coding the parenthesis with something else and then decoding on reception, but being able to send a parenthesis straight with the entity would be way smoother and less annoying.
        Created question in FIWARE Q/A platform on 19-11-2015 at 12:11
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/33803291/cant-use-parenthesis-in-an-entitys-attribute-value


        +Question:+
        Can&#39;t use parenthesis ( ) in an entity&#39;s attribute value

        +Description:+
        I've been experimenting with Orion the last few days and and after a while I made it work the way I intended to.

        I am facing an unexpected annoyance though, where a string attribute for a given entity context will fail to register.

        Example:

        http POST [my_orion_server_url]:1026/v1/updateContext &lt; create_push.json


        Where create_push.json is:

        {
            "contextElements": [
                {
                    "type": "Push",
                    "isPattern": "false",
                    "id": "Push1",
                    "attributes": [
                        {
                            "name": "message",
                            "type": "string",
                            "value": "this is a test)"
                        }
                    ]
                }
            ],
            "updateAction": "APPEND"
        }


        The server replies with:

        HTTP/1.1 200 OK
        Content-Length: 129
        Content-Type: application/json
        Date: Thu, 19 Nov 2015 11:47:03 GMT

        {
            "errorCode": {
                "code": "400",
                "details": "Illegal value for JSON field",
                "reasonPhrase": "Bad Request"
            }
        }


        If, on the other hand, I remove the parenthesis, everything works as expected:

        json file:

        {
            "contextElements": [
                {
                    "type": "Push",
                    "isPattern": "false",
                    "id": "Push1",
                    "attributes": [
                        {
                            "name": "message",
                            "type": "string",
                            "value": "this is a test"
                        }
                    ]
                }
            ],
            "updateAction": "APPEND"
        }


        Server response:

        {
            "contextResponses": [
                {
                    "contextElement": {
                        "attributes": [
                            {
                                "name": "message",
                                "type": "string",
                                "value": ""
                            }
                        ],
                        "id": "Push1",
                        "isPattern": "false",
                        "type": "Push"
                    },
                    "statusCode": {
                        "code": "200",
                        "reasonPhrase": "OK"
                    }
                }
            ]
        }


        Is this intended or a bug?

        I can overcome the issue coding the parenthesis with something else and then decoding on reception, but being able to send a parenthesis straight with the entity would be way smoother and less annoying.
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 21:12|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 21:12|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 18:12|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 18:12|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:18|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:18|CREATED monitor | # answers= 1, accepted answer= True
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: