{"action":"closed","issue":{"url":"https://api.github.com/repos/mtth/avsc/issues/206","repository_url":"https://api.github.com/repos/mtth/avsc","labels_url":"https://api.github.com/repos/mtth/avsc/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/mtth/avsc/issues/206/comments","events_url":"https://api.github.com/repos/mtth/avsc/issues/206/events","html_url":"https://github.com/mtth/avsc/issues/206","id":363766335,"node_id":"MDU6SXNzdWUzNjM3NjYzMzU=","number":206,"title":"Namespace error","user":{"login":"Michael03","id":1548262,"node_id":"MDQ6VXNlcjE1NDgyNjI=","avatar_url":"https://avatars2.githubusercontent.com/u/1548262?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael03","html_url":"https://github.com/Michael03","followers_url":"https://api.github.com/users/Michael03/followers","following_url":"https://api.github.com/users/Michael03/following{/other_user}","gists_url":"https://api.github.com/users/Michael03/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael03/subscriptions","organizations_url":"https://api.github.com/users/Michael03/orgs","repos_url":"https://api.github.com/users/Michael03/repos","events_url":"https://api.github.com/users/Michael03/events{/privacy}","received_events_url":"https://api.github.com/users/Michael03/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-25T21:06:14Z","updated_at":"2018-11-07T01:54:24Z","closed_at":"2018-11-07T01:54:24Z","author_association":"NONE","body":"With the below im getting an error that the name doesn't exist. If i make the message object contain the namespace and do the same when reading it out it works but is that correct? Should i have to specify the namespace in the object im encoding?\r\n\r\n```\r\nconst Avsc = require(\"avsc\");\r\n\r\nconst avsc = {\r\n  \"type\": \"record\",\r\n  \"name\": \"TestRecord\",\r\n \"namespace\": \"namespace.test\",\r\n  \"fields\": [\r\n    {\r\n      \"name\": \"eventDetails\",\r\n      \"type\": [\r\n        {\r\n          \"type\": \"record\",\r\n          \"name\": \"Name1\",\r\n          \"fields\": [\r\n            {\r\n              \"name\": \"NameA\",\r\n              \"type\": \"string\"\r\n            }\r\n          ]\r\n        },\r\n        {\r\n          \"type\": \"record\",\r\n          \"name\": \"Name2\",\r\n          \"fields\": [\r\n            {\r\n              \"name\": \"NameB\",\r\n              \"type\": \"string\"\r\n            }\r\n          ]\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"name\": \"working\",\r\n      \"type\": [\r\n        \"string\"\r\n      ]\r\n    }\r\n  ]\r\n};\r\n\r\nconst schema = Avsc.parse(JSON.stringify(avsc));\r\n\r\nlet message =   {\r\n  eventDetails: {\r\n    Name1: {\r\n      NameA: \"Name1AValue\",\r\n    }\r\n  },\r\n  working: \"workingValue\"\r\n};\r\nconst buffer = schema.toBuffer(message);\r\nlet parsed = schema.fromBuffer(buffer);\r\n\r\nconsole.log(parsed);\r\nconsole.log(parsed.eventDetails);\r\nconsole.log(parsed.eventDetails.Name1);\r\nconsole.log(parsed.eventDetails.Name1.NameA);\r\n\r\n\r\n```\r\nError: invalid [\"namespace.test.Name1\",\"namespace.test.Name2\"]: {\"Name1\":{\"NameA\":\"Name1AValue\"}}"}}
{"actor":{"display_login":"mtth"}}