Annotation Interface RequestJsonParam
An ext
Annotation which can resolve json param from request parameters for HandlerMethodArgumentResolver like RequestParam and RequestBody.
Define an api with RequestJsonParam like this:
@RestController
public class JsonParamController{
@GetMapping("/json")
public Object json(@RequestJsonParam Object json){
return json;
}
}
Then request this api with curl like this:
curl http://localhost:8080/json?json={"name":haha}
- 从以下版本开始:
- 1.0.0
- 版本:
- 1.0.0
- 作者:
- ilikly
- 另请参阅:
-
RequestParamRequestBodyHandlerMethodArgumentResolver
-
可选元素概要
可选元素
-
元素详细资料
-
value
- 默认值:
- ""
-
name
- 默认值:
- ""
-
required
boolean required- 默认值:
- true
-
defaultValue
String defaultValue- 默认值:
- "\n\t\t\n\t\t\n\ue000\ue001\ue002\n\t\t\t\t\n"
-