Skip to content
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

Improve description included in by DeserializationContext.handleUnexpectedToken() #2707

Closed
cowtowncoder opened this issue May 2, 2020 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented May 2, 2020

Currently handleUnexpectedToken() method creates somewhat vague exception message like:

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>`
out of FIELD_NAME token

where raw token name is not as information as it should be. But it seems simple enough to change this to something like

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Object>`
from Object value (token `JsonToken.FIELD_NAME`)

Since this changes observed API slightly, needs to go in 2.12 (instead of next 2.11 patch).

@tinarooot
Copy link

springboot

实体类接收的是

private List<ProductAttribute> productAttributeList;

但是前端如果不传这个值的时候报

] - JSON parse error: Cannot deserialize instance of java.util.ArrayList<com.cainaer.product.domain.ProductAttribute>out of VALUE_NUMBER_INT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.util.ArrayList<com.cainaer.product.domain.ProductAttribute> out of VALUE_NUMBER_INT token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants