Skip to content

fix(extract): read the url of a JS/TS request-config object (#2235) - #2354

Merged
DeusData merged 1 commit into
mainfrom
fix/issue-2235
Sep 30, 2026
Merged

DeusData merged 1 commit into
mainfrom
fix/issue-2235

Conversation

@DeusData

Copy link
Copy Markdown
Owner

A generated API client (Orval and similar) passes its request as a config
object to a local fetch wrapper:

http<Customer>({url: `/api/customers/${id}`, method: 'GET', signal})

The template literal itself already canonicalizes to "/api/customers/{}"
(#1006). What was lost is the object wrapper: the call's arguments only
carried a value for bare strings, template literals, constants and URL
builders, so the object argument had no URL. The arg-url heuristic
therefore minted no HTTP_CALLS edge, and cross-repo matching had nothing to
join against the server's GET /api/customers/{id} Route. The same held for
HTTP clients called with a config object (axios({url})): no URL, no edge.

The extractor now reads the url property of an object argument in
JS/TS/TSX/ArkTS -- both as that argument's value (for the arg-url
heuristic) and as the call's URL (for HTTP-client classification). Only
the url key counts. Route registrations (Fastify route({url, handler}))
and axios getUri(config), which formats a URL and sends nothing, are
excluded.

orval-labs/orval @ 08d7fcf1 (parallel resolver): HTTP_CALLS 1383 -> 1533
(+150 arg_url edges from the generated mutators such as customInstance,
responseType and customClient; 0 lost), Route 302 -> 308, CALLS unchanged
(19190). Without the getUri exclusion there would have been 546 URL-builder edges.


Known limit (separate follow-up): the sequential resolver (projects with 50 files or fewer) has no arg-url heuristic, so local-wrapper calls there still get no HTTP_CALLS; porting it conflicts with the pinned #856 contract test and needs a decision.

Fixes #2235

A generated API client (Orval and similar) passes its request as a config
object to a local fetch wrapper:

    http<Customer>({url: `/api/customers/${id}`, method: 'GET', signal})

The template literal itself already canonicalizes to "/api/customers/{}"
(#1006). What was lost is the object wrapper: the call's arguments only
carried a value for bare strings, template literals, constants and URL
builders, so the object argument had no URL. The arg-url heuristic
therefore minted no HTTP_CALLS edge, and cross-repo matching had nothing to
join against the server's GET /api/customers/{id} Route. The same held for
HTTP clients called with a config object (`axios({url})`): no URL, no edge.

The extractor now reads the `url` property of an object argument in
JS/TS/TSX/ArkTS -- both as that argument's value (for the arg-url
heuristic) and as the call's URL (for HTTP-client classification). Only
the `url` key counts. Route registrations (Fastify `route({url, handler})`)
and axios `getUri(config)`, which formats a URL and sends nothing, are
excluded.

orval-labs/orval @ 08d7fcf1 (parallel resolver): HTTP_CALLS 1383 -> 1533
(+150 arg_url edges from the generated mutators such as customInstance,
responseType and customClient; 0 lost), Route 302 -> 308, CALLS unchanged
(19190). Without the getUri exclusion there would have been 546 URL-builder edges.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData
DeusData merged commit 1ff6299 into main Sep 30, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cross-repo-intelligence: 0 HTTP_CALLS edges — TS template-literal path param (${id}) never matched against Spring {id} route placeholder

1 participant