topology: require --parent/--root explicitly + fix stale form doc (#492 nits)

This commit is contained in:
damocles 2026-05-26 19:21:57 +02:00 committed by Mara
commit 3dbef583a7
2 changed files with 11 additions and 3 deletions

View file

@ -852,9 +852,13 @@ struct RequestSpawnForm {
/// `POST /api/topology/set-parent` body. `child` is required.
/// `new_parent` may be:
/// - omitted entirely (form field absent) → no-op error,
/// - empty string → promote to root,
/// - absent or empty / whitespace-only → promote to root,
/// - non-empty → new parent's logical name.
///
/// (The CLI surface gates "no parent specified" behind an explicit
/// `--root` flag for safety; the HTTP surface is permissive
/// because the dashboard form encodes "no value" as the empty
/// string for the optional radio-group input.)
#[derive(Deserialize)]
struct SetParentForm {
child: String,