Galbar/JsonPath-PHP

Can't create json for $.1 ($.integer)

shalithaRukshan opened this issue · 1 comments

code:
$jsonObject = new JsonObject();
$jsonObject->set('$.1','asdf');
dd($jsonObject->getJson());


error : InvalidJsonPathExceptionError in JSONPath near '.1'

Hi!
The following should work:
$jsonObject->set('$[1]','asdf');
or
$jsonObject->set('$["1"]','asdf');