I use JSONStream to parse incoming data in a simple gateway application. The incoming data that this application responds to should adhere to a known format comprising a header, payload, etc. Further, at times, I want to make sure that a specific element exists in the incoming message so that, if it doesn't, I can then throw an error indicating an invalid message format. If I'm not mistaken, there's no straightforward way in the current implementation of JSONStream to implement the above as there's no mechanism to let the calling code know when stream processing is done. Therefore, I'm checking in too see if adding what's outlined in $subject makes sense or if there's any other workaround I could potentially use to get around the problem. If this does make sense, I'm happy to contribute with a PR too as the change is trivial and simple.
I use JSONStream to parse incoming data in a simple gateway application. The incoming data that this application responds to should adhere to a known format comprising a header, payload, etc. Further, at times, I want to make sure that a specific element exists in the incoming message so that, if it doesn't, I can then throw an error indicating an invalid message format. If I'm not mistaken, there's no straightforward way in the current implementation of JSONStream to implement the above as there's no mechanism to let the calling code know when stream processing is done. Therefore, I'm checking in too see if adding what's outlined in $subject makes sense or if there's any other workaround I could potentially use to get around the problem. If this does make sense, I'm happy to contribute with a PR too as the change is trivial and simple.
Your feedback is appreciated.