https://xxyh.xiaoli.icu/api/p_json_tool.phphttps://xxyh.xiaoli.icu/api/p_json_tool.php?text=%7B%22a%22%3A1%2C%22b%22%3A%5B2%2C3%5D%7D&mode=prettymode=pretty 美化缩进、mode=min 压成一行、mode=escape 保留中文转义。
合法时返回 valid=true 与结果,非法时返回具体错误信息,不会直接抛 500。
depth 是最大嵌套层数,排查层级过深的配置很方便。
注意 JSON 标准不允许注释与尾逗号,这类写法会判为非法。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
text |
string | 必填 | {"a":1,"b":[2,3]} | JSON 文本 |
mode |
string | 选填 | pretty | pretty / min / escape |
https://xxyh.xiaoli.icu/api/p_json_tool.php
此处将显示接口返回结果…
{
"code": 200,
"msg": "ok",
"data": {
"valid": true,
"type": "array",
"depth": 2,
"result": "{\n \"a\": 1,\n \"b\": [2, 3]\n}"
}
}
—