omnigraph/crates/omnigraph-server/src
Ragnor Comerford 8f558e6ab9
mr-668: named-field path-param structs for nested cluster routes (green)
`Path<String>` deserializes one path-param value positionally.
Single-mode flat routes (`/branches/{branch}`,
`/commits/{commit_id}`) have one capture; multi-mode nested routes
(`/graphs/{graph_id}/branches/{branch}`,
`/graphs/{graph_id}/commits/{commit_id}`) have two — axum 0.8
propagates the outer capture into nested handlers. Same handler,
two different shapes; the multi-mode shape 500s with
"Wrong number of path arguments. Expected 1 but got 2."

Symptomatic fix: change to `Path<(String, String)>` and ignore the
first element. Breaks again the moment we add another nest layer
(e.g. tenant in Cloud mode).

Correct-by-design fix: named-field structs deserialized by name
from axum's path-param map. Each handler picks only the fields it
needs. Stable across single / multi / future-cloud nest depths
because deserialization is by field name, not position.

* New `BranchPath { branch: String }` (file-local to lib.rs)
* New `CommitPath { commit_id: String }`
* `server_branch_delete` extractor → `Path<BranchPath>`
* `server_commit_show` extractor → `Path<CommitPath>`

Closes the "handler path-extractor type is positional and breaks
when route nesting changes" class. Red test from the previous
commit turns green. All 77 server tests pass (single-mode branch
delete + commit show, plus new multi-mode coverage).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 18:18:49 +02:00
..
api.rs mr-668: align GET /graphs 405 body code with HTTP status 2026-05-27 12:04:51 +02:00
auth.rs Add aws feature + SecretsManagerTokenSource backend 2026-04-18 03:48:51 +03:00
config.rs mr-668: remove POST /graphs and CLI graphs create (defer runtime graph mgmt) 2026-05-26 17:49:38 +02:00
graph_id.rs mr-668: add GraphId newtype + Cloud-mode forward identity stubs (PR 1/10) 2026-05-25 18:51:49 +02:00
identity.rs mr-668: add GraphId newtype + Cloud-mode forward identity stubs (PR 1/10) 2026-05-25 18:51:49 +02:00
lib.rs mr-668: named-field path-param structs for nested cluster routes (green) 2026-05-27 18:18:49 +02:00
main.rs Rename repo terminology to graph (#118) 2026-05-24 16:46:00 +01:00
policy.rs policy: chassis core — omnigraph-policy crate + Omnigraph::enforce() (MR-722) (#102) 2026-05-18 00:36:36 +03:00
registry.rs mr-668: cfg(test)-gate GraphRegistry::insert and its mutex 2026-05-27 13:03:59 +02:00
workload.rs server: drop unwired try_admit_rewrite / 503 admission surface 2026-05-09 20:58:17 +00:00