特定のパスに対応するように注釈が付けられた REST リソースの基本コレクションがあります。疑似コード:
@Path("/collection")
class Stuff {
@Path("/{id}")
@GET
public String get(@PathParm("id") int id) {
return String.format("Item #%d". id);
}
}
ここで、 class を変更せずにこのコレクションにサブリソースを追加する必要がありますStuff
が、以下のようなコードを追加してもうまくいきません:
@Path("/collection/{id}")
class StuffPlugin {
@Path("/extra")
@GET
public String extra(@PathParm("id") int id) {
return String.format("Extra info about item #%s", id);
}
}
これは以前は RESTeasy 2.3 で機能していましたが、バージョン 3.0.4 にアップグレードすると、Stuff
RESTeasy が可能なパスの一致を探しているときにクラスがシャドウイングされ、アプリの構造全体が壊れているように見えます。これは RESTeasy 3 でどのように達成されるでしょうか?
ありがとうございました
PS
以下のようにプロバイダークラスをプログラムで追加していますが、ベースパスが衝突していないものはすべて正常に動作しています。
public class EntryPoint extends Application {
public EntryPoint() {}
@SuppressWarnings("serial")
@Override
public Set<Class<?>> getClasses() {
return new HashSet<Class<?>>() {
{
add(Stuff.class);
add(StuffPlugin.class);
}
}
}
}