bliblidotcom / blibli-backend-framework

Blibli.com Backend Framework
https://www.blibli.com/
Apache License 2.0
75 stars 13 forks source link

@RequestParam with no name / value is not supported #44

Closed mehtakaran9 closed 3 years ago

mehtakaran9 commented 3 years ago

If you use the following: @RequestParam String requestParamOne, it will not work because the name of the param is taken by the name or value of the annotation String name = StringUtils.isEmpty(annotation.name()) ? annotation.value() : annotation.name(); Hence, the need for declaring it as follows: @RequestParam("requestParamOne") String requestParamOne But ideally, it should be taken as the default if empty, from the Parameter's name field ( parameter.getName() )

khannedy commented 3 years ago

when java already compiled to binary code, we can not get information about the paramerName, so it's not recommended to get parameter name from parameter field value name, because it will be changed after compiled to binary code