julianpeeters / avrohugger

Generate Scala case class definitions from Avro schemas
Apache License 2.0
201 stars 120 forks source link

Added unit to the set of reserved keywords #164

Closed Edefritz closed 1 year ago

Edefritz commented 1 year ago

Now unit is part of the set of the reserved keywords and will be escaped with backticks in case it is used as a property in an avro schema.

Fixes https://github.com/julianpeeters/avrohugger/issues/163

Edefritz commented 1 year ago

Hey again, may I ask for some feedback about my PR?

julianpeeters commented 1 year ago

Hi @Edefritz, thanks for looking in to this. And sorry for the delay, my plan is to continue maintaining avrohugger, but at the moment I can't offer any estimate about timeframes or availability.

With regard to this PR: I haven't tried to reproduce your error, but something seems off here: avrohugger's RESERVED_WORDS is derived, unit doesn't appear in the source.

From your error report, it seems like the problem is with how avrohugger currently can't handle conflicting namespaces: [error] required: Unit (in {my_namespace}) (if you wish to investigate this, you may like to add a test to the scripted tests in sbt-avrohugger).

And if that is the case, then the roadmap is looking something like:

  1. first, release avrohugger 2.x, still on scala 2, but generating fully qualified names only
  2. second, release avrohugger 3, on scala 3, with an improved import system that can handle namespace conflicts
Edefritz commented 1 year ago

Thanks for getting back to me! I see, I didn't know that those keywords are derived. So it doesn't seem as such a small change after all. I'm not sure I will be able to assist with a fix and would close the MR but keep the issue open.

julianpeeters commented 1 year ago

Ok great, thanks