Skip to content

Commit fcba036

Browse files
authored
Merge pull request #215 from baywet/fix/ref-rfc-9535
fix/ref rfc 9535
2 parents 960dd8c + b667690 commit fcba036

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ If you are looking for tools to use with Overlays, try these:
3030

3131
(Is something missing from the list? Send us a pull request to add it!)
3232

33+
## Support for RFC9535 JSONPath
34+
35+
[[RFC9535]] is a recent specification and libraries implementing JSONPath support might predate the RFC. Those libraries might differ entirely (expressions syntax is incompatible), implement additional capabilities (superset of the RFC), or support only a subset of the RFC.
36+
37+
In case the tool being use is not fully compliant with RFC9535, users MIGHT have to update some JSONPath query expressions to accommodate for the implementation in use.
38+
39+
This example JSONPath query expression:
40+
41+
```jsonpath
42+
$.paths.*.get.parameters[[email protected]=='filter' && @.in=='query']
43+
```
44+
45+
might require additional optional parenthesis with some implementations like so:
46+
47+
```jsonpath
48+
$.paths.*.get.parameters[?(@.name=='filter' && @.in=='query)']
49+
```
50+
3351
## Licensing
3452

3553
See: [License (Apache-2.0)](./LICENSE)

versions/1.1.0-dev.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The main purpose of the Overlay Specification is to provide a way to repeatably
2121

2222
### Overlay
2323

24-
An Overlay is a JSON or YAML structure containing an ordered list of [Action Objects](#overlay-actions) that are to be applied to the target document. Each [Action Object](#action-object) has a `target` property and a modifier type (`update` or `remove`). The `target` property is a [[RFC9535|JSONPath]] query expression that identifies the elements of the target document to be updated and the modifier determines the change.
24+
An Overlay is a JSON or YAML structure containing an ordered list of [Action Objects](#overlay-actions) that are to be applied to the target document. Each [Action Object](#action-object) has a `target` property and a modifier type (`update` or `remove`). The `target` property is a [[RFC9535|RFC9535 JSONPath]] query expression that identifies the elements of the target document to be updated and the modifier determines the change.
2525

2626
## Specification
2727

@@ -113,7 +113,7 @@ This object represents one or more changes to be applied to the target document
113113

114114
| Field Name | Type | Description |
115115
| ---- | :----: | ---- |
116-
| <a name="action-target"></a>target | `string` | **REQUIRED** A JSONPath expression selecting nodes in the target document. |
116+
| <a name="action-target"></a>target | `string` | **REQUIRED** A RFC9535 JSONPath query expression selecting nodes in the target document. |
117117
| <a name="action-description"></a>description | `string` | A description of the action. [[CommonMark]] syntax MAY be used for rich text representation. |
118118
| <a name="action-update"></a>update | Any | If the `target` selects an object node, the value of this field MUST be an object with the properties and values to merge with the selected node. If the `target` selects an array, the value of this field MUST be an entry to append to the array. This field has no impact if the `remove` field of this action object is `true`. |
119119
| <a name="action-remove"></a>remove | `boolean` | A boolean value that indicates that the target object or array MUST be removed from the the map or array it is contained in. The default value is `false`. |
@@ -284,6 +284,13 @@ The extensions may or may not be supported by the available tooling, but those m
284284
Overlay files MAY choose to follow the convention of a `purpose.overlay.yaml` file naming pattern.
285285
Other file naming conventions are also supported.
286286

287+
### RFC9535 compliance
288+
289+
[[RFC9535]] is a recent specification and libraries implementing JSONPath support might predate the RFC. Those libraries might differ entirely (expressions syntax is incompatible), or implement additional capabilities (superset of the RFC). A tool or library MUST fully implement [[RFC9535]] when parsing and expanding JSONPath query expressions to be compliant with the Overlay specification.
290+
291+
Interoperable Overlay Documents MUST use RFC9535 JSONPath query expressions and MUST NOT use tool-specific JSONPath extensions.
292+
293+
287294
### Comments in OpenAPI descriptions
288295

289296
Some formats, like [YAML](https://yaml.org/) or [JSONC](https://jsonc.org/), support using comments which do not impact the semantic meaning of the description. Applying Overlay Actions to a description MAY result in the loss of such comments in the updated description. The exact behavior is specific to the tool implementing the Overlay Specification.

0 commit comments

Comments
 (0)