Closed rvesse closed 9 months ago
May also want to consider adding a @Metadata
annotation for the metadata fields that currently use @Inject
Yes, i think this would be good change, because the inject annotation could cause problems with some other frameworks too (e.g.: cdi, weld, spring, guice, ...).
This change would break the airline-guice module, but we could use custom injection to support @Metadata
.
@rvesse I agree it would be a good change. In my case, I had to use a trick to mask the @Inject
annotations used by Airline to CDI (by having a look at the annotations and types so it's a bit brittle).
Done in 3.0.0
, only @AirlineModule
is supported out the box and javax-inject
and jakarta-inject
dependencies are now optional
and the usage of @Inject
MUST be explicitly opted into
That's very cool \o/
As described in #77 and #80 the use of the
@Inject
annotation, which is a generic Java annotation, can cause conflicts with DI frameworks like Google Guice. We use this injection as a marker for fields whose types should be scanned for Airline annotations. It may be better to replace use of this annotation with an Airline specific one e.g.@Module
to avoid these conflicts.This would be a breaking change that should go into the
3x
branch@sdorra Does this seem like a good change to make?