JSON array parsing in Java

Recently, I got through the related APIs of blog Park and other third-party APIs. Because the system I developed needs to call more third-party APIs, feign in spring cloud is used. Basically, the development of the system basically involves the use of WeChat or Alipay and the use of smart door locks for third parties.

When migrating blog data today, I found that there was a problem parsing the array when calling a third party through feign.

A similar error occurs as follows:

The reason for the problem is that the data I returned is in this format [{}], for example:

It is not possible to use jsonobject directly for parsing. You need to use jsonarray.

Problem solving core code:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>