Skip to content

Commit

Permalink
Accept "invalid" field names.
Browse files Browse the repository at this point in the history
Some of our Avro schemas are generated with "invalid" names and this
library refuses to accept them.  That would be fine if it was only
on writing an Avro schema with such fields but it also refuses to
read any Avro schema, which is highly annoying.

See also linkedin#286
  • Loading branch information
gannett-ggreer committed Dec 7, 2024
1 parent d517b19 commit f7e1082
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/linkedin/goavro/v2
module github.com/GannettDigital/linkedin_goavro/v2

go 1.12

Expand Down
1 change: 1 addition & 0 deletions name.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func checkString(s string) error {
if len(s) == 0 {
return errors.New("be non-empty string")
}
return true // https://github.com/linkedin/goavro/issues/286
if strings.IndexFunc(s[:1], isRuneInvalidForFirstCharacter) != -1 {
return errors.New("start with [A-Za-z_]: " + s)
}
Expand Down

0 comments on commit f7e1082

Please sign in to comment.