{"action":"created","issue":{"url":"https://api.github.com/repos/stealthly/go-avro/issues/52","labels_url":"https://api.github.com/repos/stealthly/go-avro/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/stealthly/go-avro/issues/52/comments","events_url":"https://api.github.com/repos/stealthly/go-avro/issues/52/events","html_url":"https://github.com/stealthly/go-avro/issues/52","id":107545434,"number":52,"title":"Panic when name is omitted","user":{"login":"mrwilby","id":3686946,"avatar_url":"https://avatars.githubusercontent.com/u/3686946?v=3","gravatar_id":"","url":"https://api.github.com/users/mrwilby","html_url":"https://github.com/mrwilby","followers_url":"https://api.github.com/users/mrwilby/followers","following_url":"https://api.github.com/users/mrwilby/following{/other_user}","gists_url":"https://api.github.com/users/mrwilby/gists{/gist_id}","starred_url":"https://api.github.com/users/mrwilby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrwilby/subscriptions","organizations_url":"https://api.github.com/users/mrwilby/orgs","repos_url":"https://api.github.com/users/mrwilby/repos","events_url":"https://api.github.com/users/mrwilby/events{/privacy}","received_events_url":"https://api.github.com/users/mrwilby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-21T16:06:01Z","updated_at":"2015-09-21T16:23:23Z","closed_at":null,"body":"I tried to use the codegen to generate code for the following schema, obtained from:\r\n\r\nhttp://wiki.pentaho.com/display/EAI/Avro+Input\r\n\r\n{\r\n  \"type\": \"map\",\r\n        \"values\":{\r\n        \"type\": \"record\",\r\n        \"name\":\"ATM\",\r\n        \"fields\": [\r\n                  {\"name\": \"serial_no\", \"type\": \"string\"},\r\n                  {\"name\": \"location\", \"type\": \"string\"}\r\n        ]\r\n        }\r\n}\r\n\r\nHowever, a panic occurs:\r\n\r\npanic: interface conversion: interface is nil, not string\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/stealthly/go-avro.parseSchemaField(0x234780, 0x8205cde90, 0x8205a5128, 0x8205cde60, 0x22, 0x1, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/schema.go:1028 +0x142\r\ngithub.com/stealthly/go-avro.parseRecordSchema(0x8205cde30, 0x8205a5128, 0x8205cde60, 0x22, 0x0, 0x0, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/schema.go:1013 +0x969\r\ngithub.com/stealthly/go-avro.schemaByType(0x234780, 0x8205cde30, 0x8205a5128, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/schema.go:962 +0x1361\r\ngithub.com/stealthly/go-avro.ParseSchemaWithRegistry(0x3815c0, 0x246, 0x8205a5128, 0x0, 0x0, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/schema.go:882 +0x182\r\ngithub.com/stealthly/go-avro.ParseSchema(0x3815c0, 0x246, 0x0, 0x0, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/schema.go:870 +0xd2\r\ngithub.com/stealthly/go-avro.(*CodeGenerator).Generate(0x8205a5560, 0x0, 0x0, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/stealthly/go-avro/codegen.go:88 +0xe7\r\nmain.main.func1(0x82057c3c0)\r\n\t/mypath/golang/src/.../schema.go:88 +0xaef\r\ngithub.com/codegangsta/cli.Command.Run(0x2feb18, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x338360, 0x1d, 0x0, ...)\r\n\t/mypath/golang/src/github.com/codegangsta/cli/command.go:127 +0x1052\r\ngithub.com/codegangsta/cli.(*App).Run(0x820594200, 0x820552100, 0x4, 0x4, 0x0, 0x0)\r\n\t/mypath/golang/src/github.com/codegangsta/cli/app.go:159 +0xc2f\r\nmain.main()\r\n\r\nIf a name property is added to the map object, then at least the panic is resolved..."},"comment":{"url":"https://api.github.com/repos/stealthly/go-avro/issues/comments/142033379","html_url":"https://github.com/stealthly/go-avro/issues/52#issuecomment-142033379","issue_url":"https://api.github.com/repos/stealthly/go-avro/issues/52","id":142033379,"user":{"login":"serejja","id":1804417,"avatar_url":"https://avatars.githubusercontent.com/u/1804417?v=3","gravatar_id":"","url":"https://api.github.com/users/serejja","html_url":"https://github.com/serejja","followers_url":"https://api.github.com/users/serejja/followers","following_url":"https://api.github.com/users/serejja/following{/other_user}","gists_url":"https://api.github.com/users/serejja/gists{/gist_id}","starred_url":"https://api.github.com/users/serejja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serejja/subscriptions","organizations_url":"https://api.github.com/users/serejja/orgs","repos_url":"https://api.github.com/users/serejja/repos","events_url":"https://api.github.com/users/serejja/events{/privacy}","received_events_url":"https://api.github.com/users/serejja/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T16:23:23Z","updated_at":"2015-09-21T16:23:23Z","body":"Codegen is intended to be used for record schemas ONLY so a map schema not wrapped around a record schema is not allowed.\r\n\r\nGiven your example though, I cannot get this panic. My output is this:\r\n\r\n```\r\nNot a Record schema.\r\nexit status 1\r\n```\r\n\r\nIf you still get this kind of panic please let me know how can I reproduce this and fix to return a message like mine."}}