为Spring多@RequestBody支持,来解决Controller中POST方式JSON格式请求时
- 无法直接用@RequestBody解析基本类型包装类的问题。
- 无法使用@RequestBody接收多个实体的问题。
- 支持通过注解的value指定JSON的key来解析对象。
- 支持通过注解无value,直接根据参数名来解析对象
- 支持基本类型的注入
- 支持GET和其他请求方式注入
- 支持通过注解无value且参数名不匹配JSON串key时,根据属性解析对象。
- 支持多余属性(不解析、不报错)、支持参数“共用”(不指定value时,参数名不为JSON串的key)
- 支持当value和属性名找不到匹配的key时,对象是否匹配所有属性。
2019年02月07日 fix 当list参数为空时,parameterType.newInstance会导致异常
- 对应博文: 明明如月小角落CSDN
- 其他参考:StackOverFlow讨论