Closed fwolfsjaeger closed 2 years ago
Because I thought it was faulty, which it actually was not. Also, my commit to fix JsonMachine\Parser::getCurrentJsonPointer()
was faulty, it is correct now.
Awesome, thank you. I'll try to do the final review asap.
JsonMachine\Items::normalizeOptions()
checks if the given 'pointer' key has a string value. I'll amend the check to not throw an exception if there is a 'pointers' key with an array value.
Ok, thanks.
I have a question. I am probably missing something. What is Parser::$jsonPointer
used for at this moment? Doesn't its purpose overlap with Parser::$currentJsonPath
?
Parser::$jsonPointer
is the matched JSON pointer, it can be fetched using Parser::getMatchedJsonPointer()
: eg. /items/-
Parser::$currentJsonPath
is the current JSON path, it's needed for Parser::getCurrentJsonPointer()
: eg. /items/0
OK, so then
Parser::getJsonPointer()
completely changed its meaning. It should preserve its original function.Parser::$jsonPointer
should be renamed to something like Parser::$matchedJsonPointer
to better reflect its purpose.Can you do it or should I?
Parser::getJsonPointer()
still returns the passed JSON pointer when inside the iteration. But fine, I have changed it so that it always just returns the first JSON pointer, it won't work with multiple pointers anymore.
Parser::$jsonPointer
is named Parser::$matchedJsonPointer
now.
it won't work with multiple pointers anymore.
That's ok as it should keep previous functionality. I plan to make 0.9.0
before 1.0.0
so I'd like to keep BC.
Parser::$jsonPointer
is namedParser::$matchedJsonPointer
now.
Thanks :)
I also need the "unused" (not iterated) JSON, so I've extended your code to store this in a variable. I hope you don't mind.