2017-07-04 68 views
0
@ApiOperation(value = "獲取打卡信息", notes = "獲取打卡信息") 
@RequestMapping(method = RequestMethod.GET, value = "/{mPhone}/{mPassword}/{date}") 
@ApiImplicitParams({ 
     @ApiImplicitParam(name = "mPhone", value = "手機號", required = true, dataType = "String",defaultValue="13268690268",paramType="Path"), 
     @ApiImplicitParam(name = "mPassword", value = "密碼", required = true, dataType = "String",defaultValue="111111",paramType="Path"), 
     @ApiImplicitParam(name = "date", value = "日期", required = true, dataType = "String",defaultValue="2017-07-04",paramType="Path"), 
     @ApiImplicitParam(name = "httpSession", value = "Session", required = false)}) 
public @ResponseBody String getSignInfo(@PathVariable String mPhone, @PathVariable String mPassword, 
     @PathVariable String date, 
     HttpSession httpSession) { 
....... 
} 

enter image description here如何隱藏在揚鞭會話參數與Springfox

我要刪除文檔中的這個參數(HttpSession中),我需要幫助。

回答

0

Springfox不會顯示這些值默認。之所以httpSession你的情況可見,是因爲你添加它自己作爲一個隱含參數:

@ApiImplicitParam(name = "httpSession", value = "Session", required = false) 

如果你不希望httpSession彈出,從你的隱含參數刪除。此外,您甚至不必在您的情況下使用@ApiImplicitParam,您可以使用@ApiParam

@ApiOperation(value = "獲取打卡信息", notes = "獲取打卡信息") 
@RequestMapping(method = RequestMethod.GET, value = "/{mPhone}/{mPassword}/{date}") 
public @ResponseBody String getSignInfo(
     @ApiParam(value = "手機號", required = true, dataType = "String",defaultValue="13268690268") 
     @PathVariable String mPhone, 
     @ApiParam(value = "密碼", required = true, dataType = "String",defaultValue="111111") 
     @PathVariable String mPassword, 
     @ApiParam(value = "日期", required = true, dataType = "String",defaultValue="2017-07-04") 
     @PathVariable String date, 
     HttpSession httpSession) { 
    // ... 
} 
+0

非常感謝。 – Arison