spring boot - how to avoid “Failed to instantiate [java.util.List]: Specified class is an interface” in HTTP controller handler?

后端 未结 2 1043
鱼传尺愫
鱼传尺愫 2021-02-19 02:28

In my spring boot REST API application, I need to handle HTTP POST by accepting a strongly-typed list as my input:

@RestController
public class CusttableControll         


        
2条回答
  •  时光说笑
    2021-02-19 02:28

    For me I had made a typo accidentally wrapping a class in a list. Removing the typo allowed serialization to happen correctly via spring data rest + jackson.

    List a; // typo
    MyClass = a;// fix
    

提交回复
热议问题