接口
认证
使用会话 Cookie 认证,或携带Authorization: Bearer <api-key>。
请求体
string
required
原始 YAML v0.3 配置字符串。
object
required
匹配 router 配置 schema 的 JSON 对象。
响应
boolean
提交的配置是否通过 schema 校验。
array
校验错误列表。
valid 为 true 时为空。Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl -X POST "https://router.example.com/v1/router/validate" \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"config":"listeners:\n - address: 0.0.0.0\n port: 8080\nproviders: []\nentrypoints: []\nrecipes: []\nglobal: {}"}'
{
"valid": false,
"errors": [
{
"path": "providers",
"message": "providers must be a non-empty array"
}
]
}
根据咏唱引擎 ROUTER 的 schema 校验原始 YAML 或 JSON 配置。不会改动任何配置。
curl -X POST "https://router.example.com/v1/router/validate" \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"config":"listeners:\n - address: 0.0.0.0\n port: 8080\nproviders: []\nentrypoints: []\nrecipes: []\nglobal: {}"}'
{
"valid": false,
"errors": [
{
"path": "providers",
"message": "providers must be a non-empty array"
}
]
}
POST /v1/router/validate
Authorization: Bearer <api-key>。
curl -X POST "https://router.example.com/v1/router/validate" \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"config":"listeners:\n - address: 0.0.0.0\n port: 8080\nproviders: []\nentrypoints: []\nrecipes: []\nglobal: {}"}'
{
"valid": false,
"errors": [
{
"path": "providers",
"message": "providers must be a non-empty array"
}
]
}
Was this page helpful?