我有一个接收抽象类的端点:
@RequestMapping(value = URL, method = RequestMethod.POST)
@ResponseBody
public ModelMap update(@RequestBody SomeAbstractClass form) {
...
}
当我发布到它时,我得到了错误:
Could not read JSON: Can not construct instance of ...,
problem: abstract types can only be instantiated with dditional type information
我明白为什么我会收到这个错误,但我不知道我会在哪里指定the additional type information
. 理想情况下,我可以通过其中一个注释来指定具体类的类型,但此时任何解决方案都足够了。