Skip to content

A serialization error causes an assignment to be sent abnormally #244

Answered by cowtowncoder
FQXCS asked this question in Q&A
Discussion options

You must be logged in to vote

Ok so this is not a stand-alone reproduction as it relies on 2 framework (Lombok, I think and ... Spring?) but gives better idea of what is happening.

While it's not clear how custom deserializer (JacksonXssClean) is registered, I guess it is registered for String values, but it also does not verify that the current token is what it expect -- it just assumes it'd be JsonToken.VALUE_STRING. Deserializer should check that because that is probably the bug here: you can not deserialize String from JSON Array like that:

            "type": [
                "01"
            ],

and type is declared as String. Calling p.getValueAsString(); on JSON Array value returns either null or String "[" (…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@FQXCS
Comment options

Comment options

You must be logged in to vote
2 replies
@FQXCS
Comment options

@cowtowncoder
Comment options

Answer selected by FQXCS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants