[英]Deserialize a complex json object + Spring boot
I have a class as below 我有一个如下课程
public class Entity {
@Id
private String id;
private String name;
private List<Person> Persons;
and I have a simple Rest request as: 我有一个简单的Rest请求,如:
@RequestMapping(value = "/create", method = RequestMethod.POST)
public ResponseEntity<?> createEntity(@RequestBody Entity entity)
There is a problem when I want to deserialize this object: 我想反序列化此对象时出现问题:
Could not read JSON document: Can not construct instance of com.example.demo.dto.Person: no String-argument constructor/factory method to deserialize from.
无法读取JSON文档:无法构造com.example.demo.dto.Person的实例:没有要反序列化的String-argument构造函数/工厂方法。
The main idea that I dont want use static inner class. 我不想使用的主要思想是静态内部类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.