Skip to content

Fix JSONPathTester not working with root level arrays#66

Merged
veler merged 2 commits intoDevToys-app:mainfrom
wiewiur667:main
Feb 20, 2025
Merged

Fix JSONPathTester not working with root level arrays#66
veler merged 2 commits intoDevToys-app:mainfrom
wiewiur667:main

Conversation

@wiewiur667
Copy link
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • New feature or enhancement
  • UI change (please include screenshot!)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Internationalization and localization
  • Other (please describe):

What is the current behavior?

JSONPathTester is not working with root level arrays like:

[
 {"foo": 1},
 {"foo": 2},
]

Issue Number: N/A

What is the new behavior?

Changed object type from JObject to more generic JToken to parse root level arrays.
Now $[0].foo will not crash tester.

Quality check

Before creating this PR:

  • Did you follow the code style guideline as described in CONTRIBUTING.md
  • Did you build the app and test your changes?
  • Did you check for accessibility? On Windows, you can use Accessibility Insights for this.
  • Did you verify that the change work in Release build configuration
  • Did you verify that all unit tests pass
  • If necessary and if possible, did you verify your changes on:
    • Windows
    • macOS
    • Linux

@veler
Copy link
Collaborator

veler commented Feb 20, 2025

Hello,
Thank you very much for this proposal! Works like a charm!

@veler veler merged commit ab94a84 into DevToys-app:main Feb 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants