🔍 Config Preflight Validator
解决 "Validation issues" 错误信息模糊的问题,在调用网关 API 前给出具体错误字段描述。
🎯 功能特性
- - Schema 同步:自动从
gateway config.schema 获取最新规范。 - 本地校验:在提交修改前,基于 JSON Schema 验证数据结构。
- 特定规则检查:针对
plugins.allow 等列表格式、channels 对象格式进行硬编码校验。
🚀 使用方法
校验补丁
CODEBLOCK0
校验完整文件
CODEBLOCK1
更新 Schema 缓存
CODEBLOCK2
🛠️ 安装要求
- - Python 3.9+
- 推荐安装
jsonschema (pip install jsonschema)
🔍 配置预检验证器
解决验证问题错误信息模糊的问题,在调用网关API前给出具体错误字段描述。
🎯 功能特性
- - Schema同步:自动从gateway config.schema获取最新规范。
- 本地校验:在提交修改前,基于JSON Schema验证数据结构。
- 特定规则检查:针对plugins.allow等列表格式、channels对象格式进行硬编码校验。
🚀 使用方法
校验补丁
bash
python3 ~/.openclaw/workspace/.lib/config-preflight-validator.py --patch {plugins: {allow: [new-plugin]}}
校验完整文件
bash
python3 ~/.openclaw/workspace/.lib/config-preflight-validator.py --file ~/.openclaw/openclaw.json
更新Schema缓存
bash
python3 ~/.openclaw/workspace/.lib/config-preflight-validator.py --update-schema
🛠️ 安装要求
- - Python 3.9+
- 推荐安装jsonschema (pip install jsonschema)