Version
Built from source, main @ 9b24332 (v0.10.8-181)
Platform / Install channel / Binary variant
Linux (x64) / Built from source / standard
What happened, and what did you expect?
JAX-RS allows @Path values without a leading slash, both on the class and on the method (@Path("widgets"), @Path("{id}")). The route extractor only accepts templates that start with /, so such resources produce no Route nodes and no HANDLES edges at all. In Java frameworks this spelling is common (JAX-RS spec, Jersey, RESTEasy, Quarkus samples).
A second, related gap: for Scala JAX-RS resources the class-level @Path prefix is not joined with the method path (it is for Java and Kotlin), so a Scala method route is emitted as the bare method template instead of <class path>/<method path>.
Expected: relative templates are accepted and normalized so the composed path is always rooted (/widgets/{id}), for Java, Kotlin and Scala alike.
Follow-up to #1005 (PR #1007 fixed class/method composition for rooted @Path values; templates without a leading slash are still rejected before composition runs).
Reproduction
- Dummy snippet (Java):
@Path("widgets")
public class WidgetResource {
@GET @Path("{id}")
public Widget get(@PathParam("id") String id) { return null; }
}
Scala variant:
@Path("/widgets")
class WidgetResource {
@GET @Path("{id}")
def get(@PathParam("id") id: String): Widget = null
}
-
Command: codebase-memory-mcp cli index_repository '{"repo_path":"/tmp/repro"}' then
codebase-memory-mcp cli search_graph '{"project":"repro","label":"Route"}'
-
Result: no Route node for the Java resource; for the Scala resource a Route with path {id}.
Expected: Route /widgets/{id} with a HANDLES edge from WidgetResource.get in both cases.
Proposed fix
I have a two-commit fix with tests (relative-template acceptance + Scala class-level composition), rebased on current main:
https://github.com/htarnacki/codebase-memory-mcp/tree/fix/jaxrs-relative-path — I will open a PR referencing this issue.
Confirmations
Version
Built from source,
main@ 9b24332 (v0.10.8-181)Platform / Install channel / Binary variant
Linux (x64) / Built from source / standard
What happened, and what did you expect?
JAX-RS allows
@Pathvalues without a leading slash, both on the class and on the method (@Path("widgets"),@Path("{id}")). The route extractor only accepts templates that start with/, so such resources produce noRoutenodes and noHANDLESedges at all. In Java frameworks this spelling is common (JAX-RS spec, Jersey, RESTEasy, Quarkus samples).A second, related gap: for Scala JAX-RS resources the class-level
@Pathprefix is not joined with the method path (it is for Java and Kotlin), so a Scala method route is emitted as the bare method template instead of<class path>/<method path>.Expected: relative templates are accepted and normalized so the composed path is always rooted (
/widgets/{id}), for Java, Kotlin and Scala alike.Follow-up to #1005 (PR #1007 fixed class/method composition for rooted
@Pathvalues; templates without a leading slash are still rejected before composition runs).Reproduction
Scala variant:
Command:
codebase-memory-mcp cli index_repository '{"repo_path":"/tmp/repro"}'thencodebase-memory-mcp cli search_graph '{"project":"repro","label":"Route"}'Result: no
Routenode for the Java resource; for the Scala resource aRoutewith path{id}.Expected:
Route/widgets/{id}with aHANDLESedge fromWidgetResource.getin both cases.Proposed fix
I have a two-commit fix with tests (relative-template acceptance + Scala class-level composition), rebased on current
main:https://github.com/htarnacki/codebase-memory-mcp/tree/fix/jaxrs-relative-path — I will open a PR referencing this issue.
Confirmations