You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm getting the following error when bootstrapping the server:
com.google.inject.ConfigurationException: Guice configuration errors:
1) No implementation for scala.collection.Seq<java.lang.String> annotated with @com.twitter.inject.annotations.Flag(value=enabled) was bound.
while locating scala.collection.Seq<java.lang.String> annotated with @com.twitter.inject.annotations.Flag(value=enabled)
for parameter 0 at com.example.MyController.<init>(MyController.scala:11)
while locating com.example.MyController
Steps to reproduce the behavior
The steps are pretty much defined in the Expected behavior section. Please let me know if you need more details.
The text was updated successfully, but these errors were encountered:
Just an update here. Flags don't currently carry enough type information to allow for correctly binding a parameterized type (like Seq or List). We could do better for binding non-parameterized types instead of always a String but without some re-working of Flags this is pretty challenging. And even then it's non-trivial to parse the parameterized types correctly via reflection to provide the correct type key for Guice binding.
Good news! In 92a4706, @vkostyukov added TypeConversions which support converting Seq and List of Flaggable types meaning that you can now define a Flag flag("things", Seq[String]("foo", "bar"), "A list of things") and inject it via:
as we now have registered Guice TypeConverters to translate the bound String type into a Seq/List of the Flaggable type. This should work for any Flag defined as a Seq/List of a Flaggable type.
Getting an error when defining a
flag
that returns aSeq
and try to inject that in aController
implementation using the@Flag
annotation.Expected behavior
Given this flag defined within a
TwitterModule
:When I inject that flag in a Controller:
Then
things
val should beSeq("foo", "bar")
Actual behavior
Currently I'm getting the following error when bootstrapping the server:
Steps to reproduce the behavior
The steps are pretty much defined in the Expected behavior section. Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: