1

I am using Spring framework for Rest Service. I have one Rest API below which has @PathVariable id. But after Proguard obfuscation , the parameter 'id' is changed to something like 'parama' which causes the REST not work because it doesn't match the definition in @RequestMapping. How can i resolve it to keep the parameter name?

@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public void getAccount(@PathVariable int id) {
        ...
}
lorcel
  • 315
  • 1
  • 3
  • 12

1 Answers1

1

The -keepparameternames keeps the parameter names in the "LocalVariableTable" and "LocalVariableTypeTable" attributes of public library methods.

Here is my proguard configuration:

-keepparameternames
-keepattributes SourceFile,LineNumberTable,*Annotation*
-keepclasseswithmembers class test.rest.controller.* {
    public <methods>;
}
Beck Yang
  • 3,004
  • 2
  • 21
  • 26