Closed EdVinyard closed 1 year ago
Kudos, SonarCloud Quality Gate passed!
Is there anything I can do to either bring this proposal up to the project's standards or help to get it integrated?
@ltwlf , is there anything I can do to either bring this proposal up to the project's standards or help to get it integrated?
@EdVinyard thanks for improving the json.diff-ts!
Goal
This PR attempts to improve the produced JSON paths when segments of the path include periods (
.
).Context
Stoplight.io has been using json-diff-ts as a test tool, and it's been working great! Thank you!
Because we're using it on OpenAPI documents, we often see periods (
.
) included in either API paths (e.g., /account/settings.json), in schema names, etc. We primarily use the "flattened" changeset format, which includes a JSON Path that refers to the change. When a period is included, the paths aren't quite as we'd expect them to be.Using the previous example of a path that includes a period described by
flattenChangeset()
...$.paths[/account/settings.json].get
$.paths./account/settings.json.get
I know that there are many other cases here I haven't covered, such as when the segment also includes open-square-bracket (
[
), but I hope this will be a minor improvement anyway. Please let me know if there's anything you'd like to see changed to incorporate this.