{"action":"opened","issue":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/2043","repository_url":"https://api.github.com/repos/telefonicaid/fiware-orion","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/2043/labels{/name}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/2043/comments","events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/2043/events","html_url":"https://github.com/telefonicaid/fiware-orion/issues/2043","id":148645573,"number":2043,"title":"Problem when Patching with autogenerated subject.condition.expression value","user":{"login":"anabelengp","id":681159,"avatar_url":"https://avatars.githubusercontent.com/u/681159?v=3","gravatar_id":"","url":"https://api.github.com/users/anabelengp","html_url":"https://github.com/anabelengp","followers_url":"https://api.github.com/users/anabelengp/followers","following_url":"https://api.github.com/users/anabelengp/following{/other_user}","gists_url":"https://api.github.com/users/anabelengp/gists{/gist_id}","starred_url":"https://api.github.com/users/anabelengp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anabelengp/subscriptions","organizations_url":"https://api.github.com/users/anabelengp/orgs","repos_url":"https://api.github.com/users/anabelengp/repos","events_url":"https://api.github.com/users/anabelengp/events{/privacy}","received_events_url":"https://api.github.com/users/anabelengp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-15T12:16:20Z","updated_at":"2016-04-15T12:16:20Z","closed_at":null,"body":"\r\nWhen I create a subscription without any `subject.condition.expression` (optional field)\r\n\r\n```\r\nPOST /v2/subscriptions HTTP/1.1\r\nContent-Type: application/json\r\nAccept: application/json\r\nFiware-Service: smartvalencia\r\nFiware-ServicePath: /testAna\r\n\r\n{\r\n    \"description\": \"One subscription to rule them all\",\r\n    \"subject\": {\r\n        \"entities\": [\r\n            {\r\n                \"idPattern\": \".*\",\r\n                \"type\": \"Car\"\r\n            }\r\n        ],\r\n        \"condition\": {\r\n            \"attributes\": [ \"temperature\" ]\r\n         }\r\n    },\r\n    \"notification\": {\r\n        \"callback\": \"http://localhost:1234\",\r\n        \"attributes\": [\"temperature\", \"humidity\"],\r\n        \"throttling\": 5\r\n    },            \r\n    \"expires\": \"2016-05-05T14:00:00.00Z\"\r\n}\r\n```\r\nI get the subscription:\r\n```\r\nGET /v2/subscriptions/5710d2ea69aa5b493a556e7d\r\nAccept: application/json\r\nFiware-Service: smartvalencia\r\nFiware-ServicePath: /testAna\r\n\r\n>>>\r\n{\r\n  \"id\": \"5710d2ea69aa5b493a556e7d\",\r\n  \"description\": \"One subscription to rule them all\",\r\n  \"expires\": \"2016-05-05T14:00:00.00Z\",\r\n  \"status\": \"active\",\r\n  \"subject\": {\r\n    \"entities\": [\r\n      {\r\n        \"id\": \"\",\r\n        \"idPattern\": \".*\",\r\n        \"type\": \"Car\"\r\n      }\r\n    ],\r\n    \"condition\": {\r\n      \"attributes\": [\r\n        \"temperature\"\r\n      ],\r\n      \"expression\": {\r\n        \"q\": \"\",\r\n        \"geometry\": \"\",\r\n        \"coords\": \"\",\r\n        \"georel\": \"\"\r\n      }\r\n    }\r\n  },\r\n  \"notification\": {\r\n    \"callback\": \"http://localhost:1234\",\r\n    \"throttling\": 5,\r\n    \"attributes\": [\r\n      \"humidity\",\r\n      \"temperature\"\r\n    ]\r\n  }\r\n}\r\n```\r\nAnd CB returns a default value for subject.condition.expression (although I dind't set any specific value)\r\n\r\nThen I try to update the subscription passing all of those fields but modifying only one of them (status):\r\n```\r\nPATCH /v2/subscriptions/5710d2ea69aa5b493a556e7d\r\nContent-Type: application/json\r\nAccept: application/json\r\nFiware-Service: smartvalencia\r\nFiware-ServicePath: /testAna\r\n\r\n{\r\n  \"description\": \"One subscription to rule them all\",\r\n  \"expires\": \"2016-05-05T14:00:00.000Z\",\r\n  \"status\": \"inactive\",\r\n  \"subject\": {\r\n    \"entities\": [\r\n      {\r\n        \"idPattern\": \".*\",\r\n        \"type\": \"Car\"\r\n      }\r\n    ],\r\n    \"condition\": {\r\n      \"attributes\": [\r\n        \"temperature\"\r\n      ],\r\n      \"expression\": {\r\n        \"q\": \"\",\r\n        \"geometry\": \"\",\r\n        \"coords\": \"\",\r\n        \"georel\": \"\"\r\n      }\r\n    }\r\n  },\r\n  \"notification\": {\r\n    \"callback\": \"http://localhost:1234\",\r\n    \"throttling\": 5,\r\n    \"attributes\": [\r\n      \"humidity\",\r\n      \"temperature\"\r\n    ]\r\n  }\r\n}\r\n```\r\nAnd the response is:\r\n```\r\n200\r\nContent-Type: application/json\r\nbody: empty q\r\n```\r\nEither the subject.condition.expression field shouln't be returned, as I didn't generated it or those empty values should be accepted"}}