{"action":"created","comment":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/comments/45718867","id":45718867,"diff_hunk":"@@ -171,23 +171,87 @@ is typically done in the REST interface)\n (placeholder to describe roles like context provider, context producer,\n context broker, context registry, context consumer)\n \n-## JSON entity representation\n+## JSON Entity Representation\n \n-An entity is represented by a a JSON object which contain the following properties:\n+An entity is represented by a JSON object with the following syntax:\n \n-* `id` for the entity ID, represented by a JSON string. If the entity has an `id` attribute itself it will be ignored.\n-* `type` for the entity type, represented by a JSON string. If the entity has a `type` attribute itself it will be ignored.\n-  If the entity doesn't have a type, then this property is not included.\n-* A collection of properties, one per entity attribute. Properties representing attributes with no metadata\n-  or type are rendered as regular JSON values. Properties representing attributes which specify a type or include\n-  metadata are rendered as JSON objects with the following properties:\n-  * `value`: for the attribute value, rendered as a regular JSON value (string, number or boolean), object or array.\n-  * `type`: a JSON string which represents the user-defined NGSI attribute type.\n-  * A collection of properties one per metadata field associated to the attribute value. Metadata properties follow\n-    the same representation rules that applies to properties which represent attributes (except that a metadata\n-    cannot have metadata properties).\n+* The entity id is specified by the object's `id` property, which value will be a string containing the entity id.\n \n-### Special attribute types\n+* The entity type is specified by the object's `type` property, which value will be a string containing the entity's type name.\n+\n+* Entity attributes are specified by additional properties, which name is the `name` of the attribute and which representation\n+  is described in the JSON Attribute Representation section below. Obviously, `id` and `type` are not allowed as attribute names.\n+\n+An example of this syntax in shown below:\n+\n+\n+```\n+{\n+  \"id\": \"entityID\",\n+  \"type\": \"entityType\",\n+  \"attr_1\": <val_1>,\n+  \"attr_2\": <val_2>,\n+  ...\n+  \"attr_N\": <val_N>\n+}\n+```\n+\n+\n+## JSON Attribute Representation\n+\n+An attribute is represented by a JSON object with the following syntax:\n+\n+* The attribute value is specified by the `value` property, which value can be any JSON datatype.\n+\n+* The attribute NGSI type is specified by the `type` property, which value will be a string containing the attribute NGSI type.\n+\n+* The attribute metadata is specified by the `metadata` property. Its value is another JSON object which will contain a\n+  property per metadata element defined (the name of the property is the `name` of the metadata element). Each metadata element,\n+  in turn, is represented by a JSON object containing the following properties:\n+\n+  * `value`: Its value will contain the metadata value, which can correspond to any JSON datatype.\n+\n+  * `type`: Its value will contain a string representation of the metadata type name.\n+\n+An example of this syntax in shown below:\n+\n+```\n+{\n+  \"value\": <...>,\n+  \"type\": <...>,\n+  \"metadata\": <...>\n+}\n+```\n+\n+## Simplified Entity Representation\n+\n+There are two representation modes, which must be supported by implementations, and which allow to generate simplified representations of entities.\n+\n+* keyValues mode. This mode represents each entity attribute only by its value, leaving out the information about type and metadata.\n+  Thus, when this mode is on, only the attribute value is represented and will correspond to the value of the property which represents the attribute.\n+  See example below (To be provided).\n+\n+* values mode. This mode represents the entity only by a collection of attribute values conveyed by an Array. Id and type information are left out.\n+  See example below (To be provided).\n+\n+## Partial representations\n+\n+Some operations imply that only a partial representation of an entity will be provided, which are summarized below:\n+\n+* `id` and `type` are forbidden in update operations, as they are inmutable properties.\n+\n+* When not forbidden, `type` can be omitted in requests. Abstent `type` means that the type is `null`.\n+\n+* Attribute/metadata `value` can be omitted in requests, meaning that the attribute/metadata has `null` value. It is always present in responses.","path":"doc/apiary/v2/fiware-ngsiv2-reference.apib","position":89,"original_position":89,"commit_id":"dce52430d14ef2d104d86ce4598d43331c2ef846","original_commit_id":"dce52430d14ef2d104d86ce4598d43331c2ef846","user":{"login":"jmcanterafonseca","id":694782,"avatar_url":"https://avatars.githubusercontent.com/u/694782?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcanterafonseca","html_url":"https://github.com/jmcanterafonseca","followers_url":"https://api.github.com/users/jmcanterafonseca/followers","following_url":"https://api.github.com/users/jmcanterafonseca/following{/other_user}","gists_url":"https://api.github.com/users/jmcanterafonseca/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcanterafonseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcanterafonseca/subscriptions","organizations_url":"https://api.github.com/users/jmcanterafonseca/orgs","repos_url":"https://api.github.com/users/jmcanterafonseca/repos","events_url":"https://api.github.com/users/jmcanterafonseca/events{/privacy}","received_events_url":"https://api.github.com/users/jmcanterafonseca/received_events","type":"User","site_admin":false},"body":"can be omitted by request payloads. In that particular case it will mean that the attribute value is not known and equal to ``null`","created_at":"2015-11-24T10:35:46Z","updated_at":"2015-11-24T10:35:46Z","html_url":"https://github.com/telefonicaid/fiware-orion/pull/1361#discussion_r45718867","pull_request_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361","_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/comments/45718867"},"html":{"href":"https://github.com/telefonicaid/fiware-orion/pull/1361#discussion_r45718867"},"pull_request":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361"}}},"pull_request":{"url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361","id":47672035,"html_url":"https://github.com/telefonicaid/fiware-orion/pull/1361","diff_url":"https://github.com/telefonicaid/fiware-orion/pull/1361.diff","patch_url":"https://github.com/telefonicaid/fiware-orion/pull/1361.patch","issue_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1361","number":1361,"state":"open","locked":false,"title":"REFACTOR rewritten JSON representation section in NGSIv2 reference apib","user":{"login":"fgalan","id":1534240,"avatar_url":"https://avatars.githubusercontent.com/u/1534240?v=3","gravatar_id":"","url":"https://api.github.com/users/fgalan","html_url":"https://github.com/fgalan","followers_url":"https://api.github.com/users/fgalan/followers","following_url":"https://api.github.com/users/fgalan/following{/other_user}","gists_url":"https://api.github.com/users/fgalan/gists{/gist_id}","starred_url":"https://api.github.com/users/fgalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgalan/subscriptions","organizations_url":"https://api.github.com/users/fgalan/orgs","repos_url":"https://api.github.com/users/fgalan/repos","events_url":"https://api.github.com/users/fgalan/events{/privacy}","received_events_url":"https://api.github.com/users/fgalan/received_events","type":"User","site_admin":false},"body":"Old \"JSON entity representation\" section has been rewritten, spliten in three subsections: \"JSON entity representation\", \"JSON attribute representation\" and \"Direct access to attribute value\" in order to match with the new JSON format (which implementation work is associated to issue #1259).\r\n\r\n@jmcanterafonseca has been assigned as main reviewer of this, but all the others (@kzangeli, \r\n@mrutid and @antoniojoseln) who have take part in the looooong ;) discussions about this (both in skype and email) are welcome to contribute to this PR with comments.","created_at":"2015-10-14T15:09:34Z","updated_at":"2015-11-24T10:35:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"857d37c07f96f52906f0573805e483a0c99b3f2a","assignee":{"login":"jmcanterafonseca","id":694782,"avatar_url":"https://avatars.githubusercontent.com/u/694782?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcanterafonseca","html_url":"https://github.com/jmcanterafonseca","followers_url":"https://api.github.com/users/jmcanterafonseca/followers","following_url":"https://api.github.com/users/jmcanterafonseca/following{/other_user}","gists_url":"https://api.github.com/users/jmcanterafonseca/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcanterafonseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcanterafonseca/subscriptions","organizations_url":"https://api.github.com/users/jmcanterafonseca/orgs","repos_url":"https://api.github.com/users/jmcanterafonseca/repos","events_url":"https://api.github.com/users/jmcanterafonseca/events{/privacy}","received_events_url":"https://api.github.com/users/jmcanterafonseca/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361/commits","review_comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361/comments","review_comment_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1361/comments","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-orion/statuses/dce52430d14ef2d104d86ce4598d43331c2ef846","head":{"label":"telefonicaid:hardening/1259_apib_new_json_description","ref":"hardening/1259_apib_new_json_description","sha":"dce52430d14ef2d104d86ce4598d43331c2ef846","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":12808420,"name":"fiware-orion","full_name":"telefonicaid/fiware-orion","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-orion","description":"FIWARE Orion Context Broker","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-orion","forks_url":"https://api.github.com/repos/telefonicaid/fiware-orion/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-orion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-orion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-orion/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-orion/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-orion/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-orion/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-orion/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-orion/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-orion/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-orion/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-orion/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-orion/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-orion/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-orion/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-orion/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-orion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-orion/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-orion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-orion/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-orion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-orion/releases{/id}","created_at":"2013-09-13T11:55:25Z","updated_at":"2015-11-24T09:31:21Z","pushed_at":"2015-11-24T09:28:44Z","git_url":"git://github.com/telefonicaid/fiware-orion.git","ssh_url":"git@github.com:telefonicaid/fiware-orion.git","clone_url":"https://github.com/telefonicaid/fiware-orion.git","svn_url":"https://github.com/telefonicaid/fiware-orion","homepage":"http://catalogue.fiware.org/enablers/publishsubscribe-context-broker-orion-context-broker","size":18005,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":48,"mirror_url":null,"open_issues_count":257,"forks":48,"open_issues":257,"watchers":35,"default_branch":"develop"}},"base":{"label":"telefonicaid:develop","ref":"develop","sha":"8c73c2ea872caa90d2d7cf7f84326f4a6be16536","user":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"repo":{"id":12808420,"name":"fiware-orion","full_name":"telefonicaid/fiware-orion","owner":{"login":"telefonicaid","id":968363,"avatar_url":"https://avatars.githubusercontent.com/u/968363?v=3","gravatar_id":"","url":"https://api.github.com/users/telefonicaid","html_url":"https://github.com/telefonicaid","followers_url":"https://api.github.com/users/telefonicaid/followers","following_url":"https://api.github.com/users/telefonicaid/following{/other_user}","gists_url":"https://api.github.com/users/telefonicaid/gists{/gist_id}","starred_url":"https://api.github.com/users/telefonicaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telefonicaid/subscriptions","organizations_url":"https://api.github.com/users/telefonicaid/orgs","repos_url":"https://api.github.com/users/telefonicaid/repos","events_url":"https://api.github.com/users/telefonicaid/events{/privacy}","received_events_url":"https://api.github.com/users/telefonicaid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telefonicaid/fiware-orion","description":"FIWARE Orion Context Broker","fork":false,"url":"https://api.github.com/repos/telefonicaid/fiware-orion","forks_url":"https://api.github.com/repos/telefonicaid/fiware-orion/forks","keys_url":"https://api.github.com/repos/telefonicaid/fiware-orion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telefonicaid/fiware-orion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telefonicaid/fiware-orion/teams","hooks_url":"https://api.github.com/repos/telefonicaid/fiware-orion/hooks","issue_events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/events{/number}","events_url":"https://api.github.com/repos/telefonicaid/fiware-orion/events","assignees_url":"https://api.github.com/repos/telefonicaid/fiware-orion/assignees{/user}","branches_url":"https://api.github.com/repos/telefonicaid/fiware-orion/branches{/branch}","tags_url":"https://api.github.com/repos/telefonicaid/fiware-orion/tags","blobs_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/refs{/sha}","trees_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telefonicaid/fiware-orion/statuses/{sha}","languages_url":"https://api.github.com/repos/telefonicaid/fiware-orion/languages","stargazers_url":"https://api.github.com/repos/telefonicaid/fiware-orion/stargazers","contributors_url":"https://api.github.com/repos/telefonicaid/fiware-orion/contributors","subscribers_url":"https://api.github.com/repos/telefonicaid/fiware-orion/subscribers","subscription_url":"https://api.github.com/repos/telefonicaid/fiware-orion/subscription","commits_url":"https://api.github.com/repos/telefonicaid/fiware-orion/commits{/sha}","git_commits_url":"https://api.github.com/repos/telefonicaid/fiware-orion/git/commits{/sha}","comments_url":"https://api.github.com/repos/telefonicaid/fiware-orion/comments{/number}","issue_comment_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/comments{/number}","contents_url":"https://api.github.com/repos/telefonicaid/fiware-orion/contents/{+path}","compare_url":"https://api.github.com/repos/telefonicaid/fiware-orion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telefonicaid/fiware-orion/merges","archive_url":"https://api.github.com/repos/telefonicaid/fiware-orion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telefonicaid/fiware-orion/downloads","issues_url":"https://api.github.com/repos/telefonicaid/fiware-orion/issues{/number}","pulls_url":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls{/number}","milestones_url":"https://api.github.com/repos/telefonicaid/fiware-orion/milestones{/number}","notifications_url":"https://api.github.com/repos/telefonicaid/fiware-orion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telefonicaid/fiware-orion/labels{/name}","releases_url":"https://api.github.com/repos/telefonicaid/fiware-orion/releases{/id}","created_at":"2013-09-13T11:55:25Z","updated_at":"2015-11-24T09:31:21Z","pushed_at":"2015-11-24T09:28:44Z","git_url":"git://github.com/telefonicaid/fiware-orion.git","ssh_url":"git@github.com:telefonicaid/fiware-orion.git","clone_url":"https://github.com/telefonicaid/fiware-orion.git","svn_url":"https://github.com/telefonicaid/fiware-orion","homepage":"http://catalogue.fiware.org/enablers/publishsubscribe-context-broker-orion-context-broker","size":18005,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":48,"mirror_url":null,"open_issues_count":257,"forks":48,"open_issues":257,"watchers":35,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361"},"html":{"href":"https://github.com/telefonicaid/fiware-orion/pull/1361"},"issue":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1361"},"comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/issues/1361/comments"},"review_comments":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361/comments"},"review_comment":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/pulls/1361/commits"},"statuses":{"href":"https://api.github.com/repos/telefonicaid/fiware-orion/statuses/dce52430d14ef2d104d86ce4598d43331c2ef846"}}}}