2017-08-16 147 views
2

我只想讓需要授權使用ApiModelProperty在Java中,但我不知道究竟在何處放置:@ApiModelProperty(value = "authorization", dataType = "java.lang.String", required = true) String authorization在我的方法:如何使用揚鞭

public Response getClienteFornitore(@HeaderParam("Authorization") String authorization, @HeaderParam("StaySignedIn") boolean staySignedIn, @PathParam("clienteFornitoreId") int clienteFornitoreId) { 

.... 

} 

我會很感激的人誰可以幫助!謝謝!

+0

你想爲需要的招搖實況它被標記,或要強制執行'授權'真的是由調用代碼設置的? – dpr

+0

我想按要求標記 – Lilly

回答

1

你可以要求你的方法簽名添加@ApiParam標註各個參數authorization

public Response getClienteFornitore(
    @ApiParam(value = "Authorization token", required = true) @HeaderParam("Authorization") String authorization, 
    @HeaderParam("StaySignedIn") boolean staySignedIn, 
    @PathParam("clienteFornitoreId") int clienteFornitoreId) { 
    ... 
} 
+0

非常感謝 – Lilly