-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueInjector break from 2.8.x to 2.9.x #1835
Comments
Since So... it is unfortunate that such a breakage occurs, but part of this is that ideally this class would not be used as an extension point. Internal classes will be more fragile over time; public API compatibility offers stronger guarantees for compatibility. I am open to adding something in |
Appreciate the quick response. For what it's worth, I also opened an issue against Finatra, because it's their custom deserialization logic that depends on a |
@kinigitbyday Much appreciated. I hope we can figure out something as these issue can certainly be nasty compatibility problems leading to dependency(-version)-hell. |
Added deprecated (for 2.9.x) constructor back, to hopefully reduce compatibility problems. |
@cowtowncoder I'm trying to upgrade finatra to 2.9.x and I'm getting bitten by this–we relied on being able to pass contextAnnotations. I can work around it by overriding |
@mosesn There probably should be. Problem is that there is no real extension point for value injection, unlike many other features that may be used via annotations (by default), or by other mechanisms that extension modules can register. But if you could explain bit more on functionality Finatra is implementing using this mechanism, maybe I could think of alternate existing mechanism(s) that could be usable? I am open for improvements (additions) both for 2.10 (which has to be compatible with 2.x in general, and hence will still have deprecated constructor), and 3.x (which will not have that constructor, but should have something to support existing uses I think). |
I think we use it with our non-json annotations. In finatra you can annotate a case class with |
@cowtowncoder Moses is correct, we're basically trying to provide functionality to parse the JSON body of an incoming request and potentially merge it with other sources into a resultant object. More information on the field annotations here. We want to be able to take the content body an incoming request, parse it as JSON and include fields injected from the 5 other supported sources into the resultant object. We use the ValueInjector to be to create a beanProperty over this incoming source to pass to the To be honest, this is some of the oldest code of the framework and is probably due to be re-evaluated -- we just have not yet done that. |
I think I understand why access to configuration is needed, and I think Jackson side unfortunately limits information passed too much. Usually I think what would make more sense in design is probably allowing registration of handlers/overrides for factory method ( I will file a new issue, linking to this one. |
The ValueInjector constructor signature changed with 76381c5#diff-dbcd29e987f27d95f964a674963a9066R24. It seems like the old one could have been deprecated instead of the hard break.
I'm using Finatra for my API layer, and it handles a lot of request object de/serialization using Jackson. I'd like to upgrade to 2.9.2, but currently can't because Finatra attempts to create an instance of ValueInjector using the old constructor (https://github.com/twitter/finatra/blob/develop/jackson/src/main/scala/com/twitter/finatra/json/internal/caseclass/utils/FieldInjection.scala#L50). It seemed better to open the issue here because I don't think Finatra should have to lock users to 2.9+.
The text was updated successfully, but these errors were encountered: