{"action":"closed","issue":{"url":"https://api.github.com/repos/klarna/erlavro/issues/60","repository_url":"https://api.github.com/repos/klarna/erlavro","labels_url":"https://api.github.com/repos/klarna/erlavro/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/klarna/erlavro/issues/60/comments","events_url":"https://api.github.com/repos/klarna/erlavro/issues/60/events","html_url":"https://github.com/klarna/erlavro/issues/60","id":293503129,"number":60,"title":"Parser requires namespace to be explicitly given in records, but specification does not.","user":{"login":"Leden","id":191432,"avatar_url":"https://avatars1.githubusercontent.com/u/191432?v=4","gravatar_id":"","url":"https://api.github.com/users/Leden","html_url":"https://github.com/Leden","followers_url":"https://api.github.com/users/Leden/followers","following_url":"https://api.github.com/users/Leden/following{/other_user}","gists_url":"https://api.github.com/users/Leden/gists{/gist_id}","starred_url":"https://api.github.com/users/Leden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leden/subscriptions","organizations_url":"https://api.github.com/users/Leden/orgs","repos_url":"https://api.github.com/users/Leden/repos","events_url":"https://api.github.com/users/Leden/events{/privacy}","received_events_url":"https://api.github.com/users/Leden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T11:55:47Z","updated_at":"2018-02-02T21:24:48Z","closed_at":"2018-02-02T21:24:48Z","author_association":"NONE","body":"The specification https://avro.apache.org/docs/1.8.1/spec.html#names says that \r\n> In record, enum and fixed definitions, the fullname is determined in one of the following ways:\r\n> ...\r\n> * A fullname is specified. If the name specified contains a dot, then it is assumed to be a fullname, and any namespace also specified is ignored. For example, use \"name\": \"org.foo.X\" to indicate the fullname org.foo.X.\r\n\r\n`erlavro` seems to follow that only partially: it understands a record name containing dots as name+namespace, but then also requires it to be equal to either a global namespace or explicitly given one:\r\nhttps://github.com/klarna/erlavro/blob/2.4.0/src/avro_record.erl#L74\r\n\r\nHere's an example from Elixir shell:\r\n```Elixir\r\niex(7)> schema = ~S/ {\r\n...(7)>       \"type\": \"record\",\r\n...(7)>       \"namespace\": \"org.foo\",\r\n...(7)>       \"name\": \"org.foo.X\",\r\n...(7)>       \"fields\": [\r\n...(7)>         {\r\n...(7)>           \"type\": \"string\",\r\n...(7)>           \"name\": \"field1\"\r\n...(7)>         }\r\n...(7)>       ]\r\n...(7)>     } /\r\n\" {\\n      \\\"type\\\": \\\"record\\\",\\n      \\\"namespace\\\": \\\"org.foo\\\",\\n      \\\"name\\\": \\\"org.foo.X\\\",\\n      \\\"fields\\\": [\\n        {\\n          \\\"type\\\": \\\"string\\\",\\n          \\\"name\\\": \\\"field1\\\"\\n        }\\n      ]\\n    } \"\r\niex(8)> :avro_json_decoder.decode_schema(schema)\r\n{:avro_record_type, \"X\", \"org.foo\", \"\", [],\r\n [{:avro_record_field, \"field1\", \"\", {:avro_primitive_type, \"string\", []},\r\n   :undefined, :ascending, []}], \"org.foo.X\", []}\r\niex(9)>     schema = ~S/ {\r\n...(9)>       \"type\": \"record\",\r\n...(9)>       \"name\": \"org.foo.X\",\r\n...(9)>       \"fields\": [\r\n...(9)>         {\r\n...(9)>           \"type\": \"string\",\r\n...(9)>           \"name\": \"field1\"\r\n...(9)>         }\r\n...(9)>       ]\r\n...(9)>     } /\r\n\" {\\n      \\\"type\\\": \\\"record\\\",\\n      \\\"name\\\": \\\"org.foo.X\\\",\\n      \\\"fields\\\": [\\n        {\\n          \\\"type\\\": \\\"string\\\",\\n          \\\"name\\\": \\\"field1\\\"\\n        }\\n      ]\\n    } \"\r\niex(10)> :avro_json_decoder.decode_schema(schema)\r\n (MatchError) no match of right hand side value: false\r\n    (erlavro) src/avro_record.erl:72: :avro_record.type/3\r\n```"}}
{"actor":{"display_login":"zmstone"}}