-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support for JacksonJsonSerializer and JacksonJsonDeserializer (@JsonSerialize and @JsonDeserialize) without special gwtjackson variants #113
Comments
I made some updates to at least support the using parameter of those annotations. But for now, the entire serializer/deserializer has to be super sourced. To reuse the jackson (de)serializer, it requires super source of all the jackson class as you said and mapping between
I don't know how you can convert JsonReader to JsonParser though. The compiler would probably be ok if you add JsonReader with a setter on your super sourced JsonParser but probably not the IDE since the signature would be different and it has no knowledge of the super source. Once it's done, it should be possible to make a custom gwt-jackson JsonSerialize and JsonDeserialize that instantiate the jackson one and call the (de)serialize method. I won't have time for such work but feel free to try! |
We have a dozen
Score
classes in OptaPlanner (= widely open source Constraint Solver in java), which are used by my users, both in their backend and their frontend. For example,HardSoftScore
implementsScore
.We maintain a set of Jackson serializers and deserializers, which are used like this, for example:
Gwtjackson doesn't pick up those 2 annotations (
@JsonSerialize
and@JsonDeserialize
) and maintaining a set of Gwtjackson JsonSerializer and JsonDeserializer is a big pain for me. Gwtjackson should be able to reuse my Jackson JsonSerializer and JsonDeserializers. It is still allowed to crash GWT compilation if those custom (de)serializers use non-GWT allowed Java code (such as reflection).How can we make that happen? Let's take a look at 2 of my implementations, I don't see any dangerous code in there for GWT:
Would it be possible to mock that
JsonGenerator
,SerializerProvider
,JsonParser
andDeserializationContext
with super sources?The text was updated successfully, but these errors were encountered: