{"action":"created","issue":{"url":"https://api.github.com/repos/sdellis/manifesto/issues/3","labels_url":"https://api.github.com/repos/sdellis/manifesto/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/sdellis/manifesto/issues/3/comments","events_url":"https://api.github.com/repos/sdellis/manifesto/issues/3/events","html_url":"https://github.com/sdellis/manifesto/issues/3","id":65338216,"number":3,"title":"Some nested data gets \"flattened\" by MongoDB","user":{"login":"sdellis","id":609368,"avatar_url":"https://avatars.githubusercontent.com/u/609368?v=3","gravatar_id":"","url":"https://api.github.com/users/sdellis","html_url":"https://github.com/sdellis","followers_url":"https://api.github.com/users/sdellis/followers","following_url":"https://api.github.com/users/sdellis/following{/other_user}","gists_url":"https://api.github.com/users/sdellis/gists{/gist_id}","starred_url":"https://api.github.com/users/sdellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdellis/subscriptions","organizations_url":"https://api.github.com/users/sdellis/orgs","repos_url":"https://api.github.com/users/sdellis/repos","events_url":"https://api.github.com/users/sdellis/events{/privacy}","received_events_url":"https://api.github.com/users/sdellis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sdellis/manifesto/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-31T01:02:29Z","updated_at":"2015-03-31T01:08:08Z","closed_at":null,"body":"There is a strange \"flattening\" of data.  Not sure if this is a MongoDB thing or not, but here is a sample:\r\n\r\nInput:\r\n```\r\n{\r\n  \"images\": [\r\n    {\r\n      \"resource\": {\r\n        \"service\": {\r\n          \"profile\": \"http:\\/\\/library.stanford.edu\\/iiif\\/image-api\\/1.1\\/conformance.html#level1\",\r\n          \"@id\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\"\r\n        },\r\n        \"format\": \"image\\/jpeg\",\r\n        \"height\": 109517,\r\n        \"width\": 6251,\r\n        \"@id\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\\/full\\/full\\/full\\/native\",\r\n        \"@type\": \"dcterms:Image\"\r\n      },\r\n      \"on\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/canvas\\/canvas-48530377.json\",\r\n      \"motivation\": \"sc:painting\",\r\n      \"@id\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/annotation\\/anno-48530377.json\",\r\n      \"@type\": \"oa:Annotation\"\r\n    }\r\n  ]\r\n}\r\n```\r\nWhen retrieved via the API:\r\n```\r\n{\r\n  \"images\": [\r\n    {\r\n      \"[resource][service][profile]\": \"http:\\/\\/library.stanford.edu\\/iiif\\/image-api\\/1.1\\/conformance.html#level1\",\r\n      \"[resource][service][@id]\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\",\r\n      \"[resource][format]\": \"image\\/jpeg\",\r\n      \"[resource][height]\": \"109517\",\r\n      \"[resource][width]\": \"6251\",\r\n      \"[resource][@id]\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\\/full\\/full\\/full\\/native\",\r\n      \"[resource][@type]\": \"dcterms:Image\",\r\n      \"[on]\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/canvas\\/canvas-48530377.json\",\r\n      \"[motivation]\": \"sc:painting\",\r\n      \"[@id]\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/annotation\\/anno-48530377.json\",\r\n      \"[@type]\": \"oa:Annotation\"\r\n    }\r\n  ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/sdellis/manifesto/issues/comments/87891441","html_url":"https://github.com/sdellis/manifesto/issues/3#issuecomment-87891441","issue_url":"https://api.github.com/repos/sdellis/manifesto/issues/3","id":87891441,"user":{"login":"sdellis","id":609368,"avatar_url":"https://avatars.githubusercontent.com/u/609368?v=3","gravatar_id":"","url":"https://api.github.com/users/sdellis","html_url":"https://github.com/sdellis","followers_url":"https://api.github.com/users/sdellis/followers","following_url":"https://api.github.com/users/sdellis/following{/other_user}","gists_url":"https://api.github.com/users/sdellis/gists{/gist_id}","starred_url":"https://api.github.com/users/sdellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdellis/subscriptions","organizations_url":"https://api.github.com/users/sdellis/orgs","repos_url":"https://api.github.com/users/sdellis/repos","events_url":"https://api.github.com/users/sdellis/events{/privacy}","received_events_url":"https://api.github.com/users/sdellis/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T01:08:08Z","updated_at":"2015-03-31T01:08:08Z","body":"Only seems to happen when nested in Manifest sequence and canvas properties.  This works:\r\n```\r\n{\r\n  \"_id\": \"sde:flatland\",\r\n  \"@id\": \"http:\\/\\/sdellis.com\\/sde:flatland\",\r\n  \"label\": \"Flatland\",\r\n  \"images\": [\r\n    {\r\n      \"resource\": {\r\n        \"service\": {\r\n          \"profile\": \"http:\\/\\/library.stanford.edu\\/iiif\\/image-api\\/1.1\\/conformance.html#level1\",\r\n          \"@id\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\"\r\n        },\r\n        \"format\": \"image\\/jpeg\",\r\n        \"height\": \"109517\",\r\n        \"width\": \"6251\",\r\n        \"@id\": \"http:\\/\\/ids.lib.harvard.edu\\/ids\\/iiif\\/48530377\\/full\\/full\\/full\\/native\",\r\n        \"@type\": \"dcterms:Image\"\r\n      },\r\n      \"on\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/canvas\\/canvas-48530377.json\",\r\n      \"motivation\": \"sc:painting\",\r\n      \"@id\": \"http:\\/\\/oculus-dev.harvardx.harvard.edu\\/manifests\\/drs:48309543\\/annotation\\/anno-48530377.json\",\r\n      \"@type\": \"oa:Annotation\"\r\n    }\r\n  ]\r\n}\r\n```"}}