How to automatically deserialize data field (Annotated with @JsonAdapter(JsonElementTypeAdapter.Factory)) #943
Unanswered
marcushoepfner
asked this question in
Q&A
Replies: 2 comments
-
|
Hi Marcus, As far as I can tell, you are correct, it cannot be done automatically. Only the server knows the actual type of |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks for your answer. I wonder whether it was possible somehow by corresponding GSON annotation or it is not possible at all. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The question is w.r.t. type hierarchy.
The LSP defines a method for
prepareTypeHierarchy(TypeHierarchyPrepareParams params)in TextDocumentService.Afterwards
typeHierarchySupertypes(TypeHierarchySupertypesParams params)ortypeHierarchySubtypes(TypeHierarchySubtypesParams params)is called.To pass data from prepare to one of the other methods a "data" member can be filled in TypeHierarchyItem.
data is annotated with:
@JsonAdapter(JsonElementTypeAdapter.Factory)While serialization of the data field into JSON is done automatically, I need to deserialize the member in super or sub method manually by calling
new Gson().fromJson(myData);I cannot find out how to get it automatically. I tried registering own JsonAdapterFactory but it did not work.
Can this be achieved or is just not foreseen?
Thanks, Marcus
Beta Was this translation helpful? Give feedback.
All reactions