From f35e70e7d3e3cd091fb9b759006023ff41997b86 Mon Sep 17 00:00:00 2001 From: wtclaude Date: Mon, 21 Sep 2026 18:28:58 -0500 Subject: [PATCH] docs(rust): record why a nested router needs nothing from the fragment generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The opposite of the hole phase 6 found: the registration walk cannot see a router mounted with `use()`, and swagger-autogen can — it reads a file and follows its requires, so `/rust/permissions` is generated with the right prefix from `rust.router.js` alone. Worth a comment where somebody will otherwise add a fifth constant to make it work. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PMH6bw1jXMgbyF3ZWGEzSM --- server/scripts/swaggerFragment.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/scripts/swaggerFragment.js b/server/scripts/swaggerFragment.js index 511e05e..2b2e0c0 100644 --- a/server/scripts/swaggerFragment.js +++ b/server/scripts/swaggerFragment.js @@ -76,6 +76,15 @@ const SLOT_MOUNT = { 'admin.users.detail': '/api/v1/admin/users/:id', } +// A router mounted INSIDE a registered one with `use()` needs nothing here, and +// that was worth finding out: swagger-autogen reads a FILE and follows its +// `require`s, so `/rust/permissions` is generated with the right prefix from +// `rust.router.js` alone. It is the opposite of the hole phase 6 found with the +// slot — the registration walk cannot see a nested router, and the generator can. +// +// A nested router exists at all because a mount prefix is ONE path segment +// (core's `PREFIX` is `/^\/[a-z0-9][a-z0-9-]*$/`), so `/rust/permissions` cannot +// be declared in `module.json` and has to be a `use()` under `/rust`. /** * Run `register()` with a recording api and return `[{ file, prefix, what }]`.