JSON Machine v1.0.0 Release Notes
Release Date: 2022-02-04 // about 2 years ago-
✂ Removed
- ✂ Removed deprecated functions
objects()
andhttpClientChunks()
. - ✂ Removed deprecated
JsonMachine
entrypoint class. UseItems
instead. - ✂ Removed deprecated
Decoder
interface. UseItemDecoder
instead. - ✂ Removed
Parser::getJsonPointer()
. UseParser::getJsonPointers()
/Items::getJsonPointers()
instead. - ✂ Removed
Parser::getJsonPointerPath()
. No replacement. Was not useful for anything other than testing and exposed internal implementation.
🔄 Changed
🛠 Simplified and fixed decoding
- JSON Pointer parts between slashes (a.k.a reference tokens) must be valid encoded JSON strings to be JSON Pointer RFC 6901 compliant.
It means that no internal key decoding is performed anymore. You will have to change your JSON Pointers if you match against keys with escape sequences.
diff Items::fromString( '{"quotes\"": [1, 2, 3]}', - ['pointer' => '/quotes"'] + ['pointer' => '/quotes\"'] );
- Method
ItemDecoder::decodeInternalKey()
was deleted as well as relatedValidStringResult
. They are not used anymore as described in previous point. PassThruDecoder
does not decode keys anymore. Both the key and the value yielded are raw JSON now.
Other
- 0️⃣ Default decoding structure of
Parser
is object. (You won't notice that unless you useParser
class directly) SyntaxError
renamed toSyntaxErrorException
Items::__construct
accepts the options array instead of separate arguments. (You won't notice that unless you instantiateItems
class directly)Lexer
renamed toTokens
DebugLexer
renamed toTokensWithDebugging
➕ Added
- 👀 Multiple JSON Pointers can be specified as an array in
pointer
option. See README. Thanks @fwolfsjaeger. - 🆕 New methods available during iteration:
Items::getCurrentJsonPointer()
andItems::getMatchedJsonPointer()
👀 to track where you are. See README. Thanks @fwolfsjaeger.
🛠 Fixed
- Incorrect position information of
TokensWithDebugging::getPosition()
. Was constantly off by 1-2 bytes.
- ✂ Removed deprecated functions