Skip to main content

formation_path

Function formation_path 

Source
pub fn formation_path(ident: &str) -> String
Expand description

Build the right /v1/formations/... path for a user-supplied identifier. CTL-002 (E2E report): the server’s /v1/formations/{id} route uses Path<Uuid> and rejects names with HTTP 400. We detect the shape locally and route to the parallel /v1/formations/by-name/{name} route when the input is not a UUID.

Detection is Uuid::parse_str(input).is_ok() — UUID-shaped strings always go to the UUID route (preserves existing operator workflows), everything else routes to by-name. We percent-encode the name with a strict path-segment set so an operator-supplied identifier containing reserved characters does not silently truncate or break path parsing on the server (/, ?, #) and so that a literal space encodes as %20 rather than + (HIGH-CTL-002-B-1).