我到了 从子类对象到超类引用执行Spring Rest Post时出错400
jUnit测试: - (失败)
SubClass subClassObj = new SubClass();
restTemplate.postForObject(restURL, subClassObj, SubClass.class);
弹簧控制器方法: -
@RequestMapping(method = RequestMethod.POST, value =
"/post-subclass-obj", headers = "Accept=application/json")
public @ResponseBody SuperClass postSubClassObj(@RequestBody SuperClass
superClassObj) {
return superClassObj;
}
jUnit测试: - (工作正常)
SuperClass superClassObj = new SuperClass();
restTemplate.postForObject(restURL, superClassObj, SubClass.class);
先谢谢!!