Open blast-hardcheese opened 5 years ago
I'm not sure how we'd go about fixing this. DW/Jersey's resource class system assumes that you group related endpoints (with related URLs) together in the same resource. If you don't do that, then this happens. The solution is just: "don't do this".
@kelnos Perhaps x-java-superclass
for a group of routes then? Otherwise there's really no way to mix user-defined methods with guardrail-supplied methods.
Ah, I think I misunderstood the use case. -superclass
seems like a neat idea. So the idea would be that user-defined routes are defined in some class, and then you tell guardrail to make that class the superclass of the guardrail-generated class? That could be interesting.
Although, another option is that you put your user-defined routes in a subclass of the guardrail-generated class. That should still work, and then we don't need to add this?
Edit: That's a bit less flexible, though... the user-defined class might already have a superclass with some common methods and such, so my alternative wouldn't work for that case.
Given the following spec, with an already registered
/Blix
in a manually created resource, the route deduplication logic that comes from applying this patch changes the resource's path handler from@Path("/v1/Foo/{foo}/Bar/{bar}")
to@Path("v1")
, which causes some of the paths to start yielding405 Method Not Allowed
with no way to call those paths anymore.