2016-07-30 13 views
0

これはREST APIに複数のパラメータを設定する正しい方法ですか?REST APIの複数のパラメータ

@GET 
@Path("/id/{userId,type,date}") 
@Nullable 
@Produces(MediaType.APPLICATION_JSON) 
List<Exercise> findExercises(
     @ApiParam(value = "User ID", required=true) @PathParam("userId") Long userId, 
     @ApiParam(value = "Type") @PathParam("type") String type, 
     @ApiParam(value = "Date") @PathParam("date") String date); 

もしそうでない場合は、どうすればできますか?

答えて

1

私はこれが正しい方法で推測:

@GET 
@Path("/id/{userId}/{type}/{date}") 
@Nullable 
@Produces(MediaType.APPLICATION_JSON) 
List<Exercise> findExercises(
     @PathParam("userId") Long userId, 
     @PathParam("type") String type, 
     @PathParam("date") String date); 
0

次のようにPARAMSパスを分離すべきである: @Path( "/ ID/{にuserId}/{タイプ}/{日付}")

関連する問題