alireza0:s-ui 的 JSON 订阅模板不是 sing-box 配置,路由键放在顶层是设计使然

在答复关于 JSON 订阅模板结构的反馈时表示,该模板不是 sing-box 配置,而是面板用来构建配置的参数对象,因此 rules、rule_set、final、default_domain_resolver 等路由键位于顶层,route 段由面板自行组装;面板表单是按这一扁平结构工作的,若同时接受嵌套 route,表单与保存下来的模板就会不一致。他也不打算在面板里再加一层校验,因为 sing-box check 已经能正确校验且始终与所用 sing-box 版本匹配。他承认文档缺口真实存在,会补上模板结构与支持字段的说明,并表示对方的变通写法本身就是受支持的形式。

作者原文

Thanks for the detailed repro and for confirming the workaround.

The JSON subscription template isn't a sing-box config — it's a settings object the panel uses to build one. That's why the routing keys (rules, rule_set, final, default_domain_resolver) go at the top level: the panel assembles the route section itself. The form in the panel is the intended way to edit it, and it works with that flat structure, so accepting a nested route as well would put the form and the saved template out of sync.

For validation: sing-box check already verifies this correctly and always matches your sing-box version, so I'd rather not ship a second, weaker check in the panel.

The documentation gap is real though — I'll document the expected template structure and the supported keys.

Your workaround is the supported form, so nothing more is needed on your side. Thanks again for the clear report.