{"action":"created","issue":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1991","repository_url":"https://api.github.com/repos/telefonicaid/fiware-orion","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1991/labels{/name}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1991/comments","events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1991/events","html_url":"https://github.com/telefonicaid/fiware-orion/issues/1991","id":145645514,"number":1991,"title":"[BUG] in POST v2/subscriptions with \"q\" condition having invalid operator in ranges","user":{"login":"iariasleon","id":4330098,"avatar_url":"https://avatars.githubusercontent.com/u/4330098?v=3","gravatar_id":"","url":"https://api.github.com/users/iariasleon","html_url":"https://github.com/iariasleon","followers_url":"https://api.github.com/users/iariasleon/followers","following_url":"https://api.github.com/users/iariasleon/following{/other_user}","gists_url":"https://api.github.com/users/iariasleon/gists{/gist_id}","starred_url":"https://api.github.com/users/iariasleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iariasleon/subscriptions","organizations_url":"https://api.github.com/users/iariasleon/orgs","repos_url":"https://api.github.com/users/iariasleon/repos","events_url":"https://api.github.com/users/iariasleon/events{/privacy}","received_events_url":"https://api.github.com/users/iariasleon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/APIv2","name":"APIv2","color":"5319e7"},{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/P6","name":"P6","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones/30","html_url":"https://github.com/telefonicaid/fiware-orion/milestones/NGSIv2SubscriptionValidation","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones/30/labels","id":1677660,"number":30,"title":"NGSIv2SubscriptionValidation","description":null,"creator":{"login":"crbrox","id":1384296,"avatar_url":"https://avatars.githubusercontent.com/u/1384296?v=3","gravatar_id":"","url":"https://api.github.com/users/crbrox","html_url":"https://github.com/crbrox","followers_url":"https://api.github.com/users/crbrox/followers","following_url":"https://api.github.com/users/crbrox/following{/other_user}","gists_url":"https://api.github.com/users/crbrox/gists{/gist_id}","starred_url":"https://api.github.com/users/crbrox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crbrox/subscriptions","organizations_url":"https://api.github.com/users/crbrox/orgs","repos_url":"https://api.github.com/users/crbrox/repos","events_url":"https://api.github.com/users/crbrox/events{/privacy}","received_events_url":"https://api.github.com/users/crbrox/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":2,"state":"open","created_at":"2016-04-01T08:51:18Z","updated_at":"2016-04-28T09:33:02Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-04T10:36:28Z","updated_at":"2016-04-29T11:05:04Z","closed_at":null,"body":" in POST v2/subscriptions with \"q\" condition having invalid operator in ranges. Only allowed `==` or `!=`.\r\n\r\nSee`Simple Query Language` in [fiware-ngsiv2-reference](http://telefonicaid.github.io/fiware-orion/api/v2/).\r\n\r\n#### subscription request\r\n```\r\nPOST http://localhost:1026/v2/subscriptions\r\nContent-Type: application/json\r\nFiware-Service: test_condition_expression_error\r\nFiware-ServicePath: /test\r\n{\"notification\": {\"callback\": \"http://localhost:1234\", \"attributes\": [\"temperature\"]}, \"expires\": \"2016-04-05T14:00:00.00Z\", \"subject\": {\"entities\": [{\"idPattern\": \".*\", \"type\": \"room\"}], \"condition\": {\"attributes\": [\"temperature\"], \"expression\": {\"q\": \"speed<99..190\"}}}}\r\n```\r\n\r\n#### subscription response\r\n```\r\nhttp code: 201\r\ndate: Mon, 04 Apr 2016 10:21:14 GMT\r\nconnection: Keep-Alive\r\ncontent-length: 0\r\nlocation: /v2/subscriptions/5702401a0f6b2ac1b6346efd\r\n```\r\n\r\n#### mongo docs\r\n```\r\n{ \"_id\" : ObjectId(\"570240190f6b2ac1b6346efa\"), \"expiration\" : NumberLong(1459864800), \"reference\" : \"http://localhost:1234\", \"throttling\" : NumberLong(0), \"servicePath\" : \"/test\", \"entities\" : [ { \"id\" : \".*\", \"type\" : \"room\", \"isPattern\" : \"true\" } ], \"attrs\" : [ \"temperature\" ], \"conditions\" : [ { \"type\" : \"ONCHANGE\", \"value\" : [ \"temperature\" ] } ], \"expression\" : { \"q\" : \"speed>=69..90\", \"geometry\" : \"\", \"coords\" : \"\", \"georel\" : \"\" }, \"format\" : \"JSON\" }\r\n{ \"_id\" : ObjectId(\"5702401a0f6b2ac1b6346efb\"), \"expiration\" : NumberLong(1459864800), \"reference\" : \"http://localhost:1234\", \"throttling\" : NumberLong(0), \"servicePath\" : \"/test\", \"entities\" : [ { \"id\" : \".*\", \"type\" : \"room\", \"isPattern\" : \"true\" } ], \"attrs\" : [ \"temperature\" ], \"conditions\" : [ { \"type\" : \"ONCHANGE\", \"value\" : [ \"temperature\" ] } ], \"expression\" : { \"q\" : \"speed>69..90\", \"geometry\" : \"\", \"coords\" : \"\", \"georel\" : \"\" }, \"format\" : \"JSON\" }\r\n{ \"_id\" : ObjectId(\"5702401a0f6b2ac1b6346efc\"), \"expiration\" : NumberLong(1459864800), \"reference\" : \"http://localhost:1234\", \"throttling\" : NumberLong(0), \"servicePath\" : \"/test\", \"entities\" : [ { \"id\" : \".*\", \"type\" : \"room\", \"isPattern\" : \"true\" } ], \"attrs\" : [ \"temperature\" ], \"conditions\" : [ { \"type\" : \"ONCHANGE\", \"value\" : [ \"temperature\" ] } ], \"expression\" : { \"q\" : \"speed<=69..79\", \"geometry\" : \"\", \"coords\" : \"\", \"georel\" : \"\" }, \"format\" : \"JSON\" }\r\n{ \"_id\" : ObjectId(\"5702401a0f6b2ac1b6346efd\"), \"expiration\" : NumberLong(1459864800), \"reference\" : \"http://localhost:1234\", \"throttling\" : NumberLong(0), \"servicePath\" : \"/test\", \"entities\" : [ { \"id\" : \".*\", \"type\" : \"room\", \"isPattern\" : \"true\" } ], \"attrs\" : [ \"temperature\" ], \"conditions\" : [ { \"type\" : \"ONCHANGE\", \"value\" : [ \"temperature\" ] } ], \"expression\" : { \"q\" : \"speed<99..190\", \"geometry\" : \"\", \"coords\" : \"\", \"georel\" : \"\" }, \"format\" : \"JSON\" }\r\n```\r\n\r\n#### expected response\r\n```\r\nhttp code: 400\r\n{\"error\":\"BadRequest\",\"description\":\"invalid query expression\"}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/comments/215685027","html_url":"https://github.com/telefonicaid/fiware-orion/issues/1991#issuecomment-215685027","issue_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1991","id":215685027,"user":{"login":"iariasleon","id":4330098,"avatar_url":"https://avatars.githubusercontent.com/u/4330098?v=3","gravatar_id":"","url":"https://api.github.com/users/iariasleon","html_url":"https://github.com/iariasleon","followers_url":"https://api.github.com/users/iariasleon/followers","following_url":"https://api.github.com/users/iariasleon/following{/other_user}","gists_url":"https://api.github.com/users/iariasleon/gists{/gist_id}","starred_url":"https://api.github.com/users/iariasleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iariasleon/subscriptions","organizations_url":"https://api.github.com/users/iariasleon/orgs","repos_url":"https://api.github.com/users/iariasleon/repos","events_url":"https://api.github.com/users/iariasleon/events{/privacy}","received_events_url":"https://api.github.com/users/iariasleon/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T11:05:04Z","updated_at":"2016-04-29T11:05:04Z","body":"In the version:\r\n```\r\n  \"version\" : \"1.0.0-next\"\r\n  \"git_hash\" : \"fee3d035442e78c1a2e19720f68bdeba083ca560\",\r\n```\r\n\r\nAnd they respond:\r\n```\r\nhttp code: 200\r\ndate: Fri, 29 Apr 2016 10:54:25 GMT\r\nfiware-correlator: bd2f4a12-0df8-11e6-ac5a-005056a20feb\r\nconnection: Keep-Alive\r\ncontent-type: application/json\r\ncontent-length: 35\r\nranges only valid for == and != ops\r\n\r\n      | q                |      response payload \r\n      |------------------|-------------------------------------|\r\n      | speed>=69..90    | ranges only valid for == and != ops |\r\n      | speed>69..90     | ranges only valid for == and != ops |\r\n      | speed<=69..79    | ranges only valid for == and != ops |\r\n      | speed<99..190    | ranges only valid for == and != ops |\r\n      | speed==99....190 | invalid range: types mixed          |\r\n      | speed==99,,,190  |  empty item in list                 |\r\n\r\n```"}}