You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JsonPath, the compact dot notation for segments is a shortcut making it easier to access keys that can be written as an identifier. The canonical form is to use the bracket notation with the property name as a (quoted) string: https://www.rfc-editor.org/rfc/rfc9535#name-segments
However, our JsonPath class building an expression is always using the dot notation, without checking that the provided keys is a valid identifier.
Symfony version(s) affected
7.3.0
Description
In JsonPath, the compact dot notation for segments is a shortcut making it easier to access keys that can be written as an identifier. The canonical form is to use the bracket notation with the property name as a (quoted) string: https://www.rfc-editor.org/rfc/rfc9535#name-segments
However, our
JsonPath
class building an expression is always using the dot notation, without checking that the provided keys is a valid identifier.https://github.com/symfony/symfony/blob/v7.3.0/src/Symfony/Component/JsonPath/JsonPath.php#L33
How to reproduce
Possible Solution
We should either always use the bracket notation or select the notation based on the key.
Additional Context
No response
The text was updated successfully, but these errors were encountered: