java.lang.IllegalStateException:No primary or default constructor found for interface java.util.List

时间:2024-03-18 15:25:34

java.lang.IllegalStateException: No primary or default constructor found for interface java.util.List
java.lang.IllegalStateException:No primary or default constructor found for interface java.util.List
原因:springboot测试List接口时JSON传参异常,接口接受不规范

解决:将对应Controller层的方法由原来的@GetMapping改成@PostMapping,并将@RequestBody放入对应List前