Skip to main content
DevTools24

JSONPath 测试工具

针对 JSON 数据测试 JSONPath 表达式。查询嵌套对象并提取特定值。

JSONPath Syntax:
$ - Root object
.property - Child property
[n] - Array index
[-1] - Last element
[*] - All elements
[0:2] - Slice (start:end)

JSONPath 语法 - 技术详情

JSONPath 类似于 JSON 的 XPath。使用 $ 表示根,.property 表示子级,[n] 表示数组索引,[*] 表示所有项,[start:end] 表示切片。它对于从复杂 JSON 结构中提取数据很有用。

命令行替代方案

// JSONPath examples\n$.store.books[0].title\n$.store.books[*].author\n$..price\n$.store.books[-1]