linkedin / linkedin/goavro

goavro.NewCodec() does not detect schema error

Open
#219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.1k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

The following AVRO Schema is invalid, but `goavro.NewCodec()` does not return an error:
```
{
"type":"record",
"name":"test",
"namespace":"com.example",
"fields":[
{
"name":"configuration",
"type":{
"type":"record",
"name":"configuration",
"fields":[
{
"name":"scene",
"type":{
"type":"record",
"name":"scene",
"fields":[
{
"name":"small",
"type":"string"
}
]
}
},
{
"name":"zoom",
"type":{
"type":"record",
"name":"scene",
"fields":[
{
"name":"small",
"type":"string"
}
]
}
}
]
}
}
]
}
```
Using https://json-schema-validator.herokuapp.com/avro.jsp for validating the schema detects the error:

```
Conversion result: failure
[ {
"level" : "fatal",
"message" : "illegal Avro schema",
"exceptionClass" : "org.apache.avro.SchemaParseException",
"exceptionMessage" : "Can't redefine: com.example.scene",
"info" : "other messages follow (if any)"
} ]
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the invalid nested-record schema with goavro.NewCodec() and trace how duplicate fully qualified names are validated. Done means NewCodec() returns an error for the shown schema and a regression test preserves that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.