知识卡片

普通读书笔记卡 · 10296.b.1.c.3.b · 生成模型:未记录

JSON Pointer定位

理解等级:中级

JSON Pointer 由逐级定位的键名或数组下标组成。/info/title 取对象中的标题。OpenAPI 的 paths 对象常用整条 URL 路径作键,键里的斜杠需写成 ~1,波浪号写成 ~0。把这种地址用于 Spectral 例外,可将整份定义的一条规则例外限在具体的操作或字段。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • JSON Pointer 入门 本章导言与正文 · 查看原书依据

      Spectral uses the JSON Pointer syntax to specify the part of a JSON document to apply an override to. JSON Pointer is a syntax for locating a value within a JSON document, and the specification is defined in RFC6901. The syntax is a string of zero or more tokens prefixed by the “/” character. You can see this in action

    参考来源

    - 位置:《Automating API Delivery APIOps with OpenAPI》《附录 C JSON Pointer 入门》(本章导言与正文;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/appendix-c.xhtml) - 结论依据:附录给出逐级访问、数组下标及路径键特殊字符的定位例。 - 原始内容:Spectral uses the JSON Pointer syntax to specify the part of a JSON document to apply an override to. JSON Pointer is a syntax for locating a value within a JSON document, and the specification is defined in RFC6901. The syntax is a string of zero or more tokens prefixed by the “/” character. You can see this in action