Jackson Json parse error

주싱·2022년 3월 11일
0

Java

목록 보기
4/6
post-custom-banner

Certain hardware communication specifications require that positive numbers always be appended with a '+' value. So, in the intermediate JSON message, I implemented a positive number with a '+' and wrote code that deserializes it as a Java object. I ran into the following issues.

Problem

In the process of deserializing the below Json string into a Java object using the Jackson library, the following error occurred.

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('3' (code 51)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value

Cause

The cause is the '+' sign to the positive 3.0 value highlighted below.

Conclusion

When deserializing in the Jackson library, it seems that you should not add a sign to the positive number.

profile
소프트웨어 엔지니어, 일상
post-custom-banner

0개의 댓글