次のようなインターフェイスがあります。
@Path("/myapi")
@Produces("application/json")
@Consumes("application/json")
public interface MyRestApi {
/// Some methods here that accept complex object and work fine
@GET
@Path("/methodwithstring")
public void methodWithString(final String thumbprint,
@Context final HttpServletResponse response);
}
メソッドに文字列を渡すと、この"some-string" のmethodWithString
ような文字列が得られます。問題は引用符です。" で囲まれたメソッドに文字列が届きます。 " で囲まずに渡す方法を理解したいと思います。
クラスが「application / json」を消費するためだと思います。パラメータとして文字列を渡すのはこれが初めてで、この問題を回避する方法がわかりません。