Closed karolchmist closed 5 years ago
The tests in avrohugger
and sbt-avrohugger
pass.
Maybe there is a better way to achieve it, but that's my naïve approach.
It makes sense to me though to look for imports only at one depth level, since we don't care about indirect dependencies in this case.
Closing since it won't be merged
We have nested records that produce two classes,
Outer
andInner
. If theInner
class uses a class from a different package, it would import it. However, theOuter
class would import it as well with the current version of avrohugger.This produces warnings in scala compiler if flag
-Ywarn-unused-import:true
is used.This PR fixes it by providing an option to limit the depths that the
Importer
would go searching for imports of dependent schemas.The new tests add a case for this scenario. Without this PR, those that would fail because the
BarOuter
class would haveimport example.importing.nested.foo.Status
.