Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memberNameShorthand should allow numbers at the beginning of a name #97

Closed
wants to merge 1 commit into from

Conversation

AndyPermaRobotics
Copy link

We needed the following JSON Path $.heads.0.value

To extract a value of the following JSON:

{
  "heads": {
     "0": {
       "value": 250
     }
  }
}

The JSONPath Syntax allows this (see: https://jsonpath.com/)

@f3ath
Copy link
Owner

f3ath commented Apr 1, 2024

Thanks for the PR. This implementation follows RFC 9535 which requires the member name shorthand to start with an alphabet character. To select the value in your example, you can use $.heads['0'].value. Please LMK if this helps.

@f3ath
Copy link
Owner

f3ath commented Apr 1, 2024

A few examples can be found here

"name": "union sq field on object (numeric key)",

@AndyPermaRobotics
Copy link
Author

Oh thanks a lot!
I did not expect this capability in JSON Path.

@f3ath f3ath closed this Apr 2, 2024
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.

2 participants