-
-
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
Possibly wrong TokenBuffer
delegate deserialization using @JsonCreator
#592
Comments
It is intended behavior at this point, in that deserializers that handle JSON Objects need to accept both the case where current token is Also, since However, all relevant values should be contained, so missing Also: as you point out, due to the way |
Thank you for the explanation. I solved somewhat similar problems in generated marshalers by always require that marshaler expects current token to be the first token as a precondition and leaves parser on a last token as a post condition and with some temporary copying to buffer for a polymorphic deserialization, but it's definitely not trivial having a lot of different deserializers. As a workaround for my usecase, I replaced |
Right, originally expectation was what one would expect ( But given that |
@elucash Thank you again for reporting this -- surprising it hadn't been noticed before. |
Thank you @cowtowncoder for the quick fix! |
Given JSON string is
{ "a":1, "b":null }
, it is expected that while deserializing using delegate buffer,current token will be start object
{
, and rest of the tokens will be available in buffer:But, buffers ends up being started with field name and then contains single attribute value
It's due to how
TokenBuffer#copyCurrentStructure
works when we have current token as aFIELD_NAME
, rather thanSTART_OBJECT
, because it's forced to move to next token BeanDeserializer.java:120Hope this helps to nail it down. Is it an intended behavior, or it's regression/bug?
The text was updated successfully, but these errors were encountered: