DOMDOM
0posts
today
total
personal posts · since 2021

Fragments
of a day.

A small notebook for slow moments slipping by.

2023 IT Creator
2024 Food Creator
2025 News Creator
2026 News Creator

Latest Posts최근

tistory view

Back to Home

[오류해결] JAVA에서 JSON API parse시 ALLOW_NON_NUMERIC_NUMBERS, Object타입 등의 에러해결

728x90
반응형

 

 

자바에서 JSON API 호출 시 나는 에러

 

Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow

위와 같은 에러 해결에는 mapper.enable ALLOW_NON_NUMERIC_NUMBERS 추가

 ObjectMapper mapper = new ObjectMapper();
mapper.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS.mappedFeature());

 

 

Cannot deserialize value of type `java.util.ArrayList<java.lang.Object>` from Object value (token `JsonToken.START_OBJECT`)

Object 타입 에러에는 configure ACCEPT_SINGLE_VALUE_AS_ARRAY 추가!

ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
728x90
반응형

Comments

Thanks for staying up late.

keep wandering · keep listening