We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
An exception is thrown when using square brackets to access properties at the root of an object.
const data = { "@id": "test" } JSONPath({json: data, path: "$['@id']", wrap: false});
TypeError: Unknown value type
I should be able to select attributes at the root of an object that start with special characters such as "@id"
In the example above I expect to get "test" as a result
"jsonpath-plus": "^10.4.0",
This works when accessing a nested object (For example, "$.foo['@id']")
Describe the bug
An exception is thrown when using square brackets to access properties at the root of an object.
Code sample
Console error or logs
TypeError: Unknown value type
Expected behavior
I should be able to select attributes at the root of an object that start with special characters such as "@id"
Expected result
In the example above I expect to get "test" as a result
Environment (IMPORTANT)
"jsonpath-plus": "^10.4.0",
Desktop**
Extra Info
This works when accessing a nested object (For example, "$.foo['@id']")