From d42a700e16949f913f120a291237b7844b152fb8 Mon Sep 17 00:00:00 2001 From: Erik Wilde Date: Sat, 1 Feb 2025 11:37:15 +0100 Subject: [PATCH 1/3] docs(repo): update 4a-rules.md --- docs/guides/4a-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/4a-rules.md b/docs/guides/4a-rules.md index 8a6f3792a..30b8b7eb3 100644 --- a/docs/guides/4a-rules.md +++ b/docs/guides/4a-rules.md @@ -36,7 +36,7 @@ Let's look at all the properties that can be used for a rule. The `given` property is conceptually similar to a selector in CSS, in that it indicates the part of the document to apply rules to. -`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath isn't yet a standard (it [should be](https://tools.ietf.org/html/draft-normington-jsonpath-00) someday), and has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. +`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath is standardized by [IETF RFC 9535](https://datatracker.ietf.org/doc/rfc9535/) and has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. Your `given` value can be a string containing any valid JSONPath expression, or an array of expressions to apply a rule to multiple parts of a document. You can also consume your [aliases](4c-aliases.md) here if you have some defined. From ffb33bd0cf8009b6b25eab32b14dc4fbd0acd58d Mon Sep 17 00:00:00 2001 From: Erik Wilde Date: Tue, 4 Feb 2025 17:31:08 +0100 Subject: [PATCH 2/3] docs(repo): explaining relationship to RFC 9535 --- docs/guides/4a-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/4a-rules.md b/docs/guides/4a-rules.md index 30b8b7eb3..977a9c2d9 100644 --- a/docs/guides/4a-rules.md +++ b/docs/guides/4a-rules.md @@ -36,7 +36,7 @@ Let's look at all the properties that can be used for a rule. The `given` property is conceptually similar to a selector in CSS, in that it indicates the part of the document to apply rules to. -`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath is standardized by [IETF RFC 9535](https://datatracker.ietf.org/doc/rfc9535/) and has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. +`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. Currently the implementation that Spectral uses is not fully aligned with [IETF RFC 9535](https://datatracker.ietf.org/doc/rfc9535/) (published in February 2024) which also is titled "JSONPath". Your `given` value can be a string containing any valid JSONPath expression, or an array of expressions to apply a rule to multiple parts of a document. You can also consume your [aliases](4c-aliases.md) here if you have some defined. From f832adb273e936a849ec5099d5160885f10c1f37 Mon Sep 17 00:00:00 2001 From: Erik Wilde Date: Tue, 15 Apr 2025 15:09:44 +0200 Subject: [PATCH 3/3] docs(repo): adding frank's suggestion Co-authored-by: Frank Kilcommins --- docs/guides/4a-rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/4a-rules.md b/docs/guides/4a-rules.md index 977a9c2d9..70ee3a5ee 100644 --- a/docs/guides/4a-rules.md +++ b/docs/guides/4a-rules.md @@ -36,7 +36,7 @@ Let's look at all the properties that can be used for a rule. The `given` property is conceptually similar to a selector in CSS, in that it indicates the part of the document to apply rules to. -`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. Currently the implementation that Spectral uses is not fully aligned with [IETF RFC 9535](https://datatracker.ietf.org/doc/rfc9535/) (published in February 2024) which also is titled "JSONPath". +`given` has a specific syntax known as [JSONPath](https://goessner.net/articles/JsonPath/index.html), which is similar to XPath. JSONPath has a few competing implementations. Spectral uses [nimma](https://www.npmjs.com/package/nimma) as its main implementation, and sometimes resorts to [jsonpath-plus](https://www.npmjs.com/package/jsonpath-plus) to ensure backwards-compatibility. Both support all the main JSONPath functionality and a bit more, but this syntax may differ slightly from other JSONPath implementations. Currently the implementation that Spectral uses is not fully aligned with [IETF RFC 9535](https://datatracker.ietf.org/doc/rfc9535/) (published in February 2024) which also is titled "JSONPath". Once supported by the underlying implementations, we will look to make available within Spectral. Your `given` value can be a string containing any valid JSONPath expression, or an array of expressions to apply a rule to multiple parts of a document. You can also consume your [aliases](4c-aliases.md) here if you have some defined.