-
-
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
Tree Model (JsonNode) with global typing #353
Comments
Ok thanks. I'll have to see what happens: although polymorphic types should not really apply to JSON Tree Model (it is only for POJOs; and Tree Model is json-specific, untyped model), it should be possible be possible to make things work well enough together. |
Also: I assume this can be reproduced with 2.3.0. |
Yes, I have checked at latest master. |
Running into the same issue. Any resolution in sight? |
Hmmh. Looking at example, it is much more involved than I realized -- and combination of custom deserializer with polymorphic types can be challenging. @cemo One quick note: with polymorphic types, instead of "deserialize()", the method to (also) override is
but default from |
Another minor improvement suggestion -- not related to the issue itself, but maybe useful: instead of:
can do:
where 'path()' never returns null (but gives 'MissingNode' if no property exists); and 'textValue()', conversely, does return null for non-text nodes (including |
Ok. Unless I am mistaken, this is fixed for 2.4 (master branch), but not 2.3 branch. This is (as I recall) due to refactoring that could only be made in master. |
Assume it is fixed with 2.4; possibly due to a fix for #88. |
I just tried it with the 2.4 snapshot and I am happy to report that valueToTree appears to be working! thanks. However, now on the server side, the jsonrpc4j code is trying to go the other direction tree to object via "readTree" and appears to be getting a similar error:
|
@snowtoad2 Thank you for quick verification of the orgiinal problem. Could you please file a new bug for the remaining problem? This way it is easier to keep track of what has been fixed, what hasn't. |
I was working on a test case and discovered I still had the older version of jackson on my json rpc server. Once I swapped that for the snapshot everything is now working! So I will not be opening up a new issue. 8) Thanks for the quick turn-around. |
Good, thank you for verifying this! |
I am trying to persist my spring security based entities to database. I need to serialize Session Attributes Map<String, Object> to database correctly by preserving their id infos. I had enabled object mapper as this:
mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.NON_FINAL, "@class");
. However when I tried to deserialize, I am having an issue.I can actually see
@class
in my output but still causing an error.{"@class":"com.fasterxml.jackson.databind.jsontype.TestDefaultForObject$SavedCookie","name":"Cemo","value":"a","comment":"co","domain":"do","maxAge":12,"path":"/asd","secure":true,"version":12}
I started to consider that there is little bug. You can also check yourself too.
The text was updated successfully, but these errors were encountered: