Easy-peazy. This is only possible because the data is structured. If you had something spitting out random bits of data on the other end then and the only way to make since of it is by inferring some value solely by type -- then it's time to refactor what is doing the serialization to begin with.
I got the idea of key+value pairs, I just assume that if the data had some more properties other then type, Alain would have used that, because that makes the problem much easier. Maybe refactoring is needed, maybe there is a reason as to why this Is the case, I can't tell for sure.
What you are suggesting would be the equivalent to sending a mixed bag and praying the computing gods that nothing dangerous will happen (spoilers: it will).
Thanks trying to help,when some are just trying to show how "smart" they are.
I give up this topic and probably this forum.
There's no need for ad hominem attacks, Alain. I have a lot of experience with serialization, and I thought I was being helpful by suggesting you go back to your client to fix their serializer instead of hacking around it's unstructured output. Perhaps there is a valid case for dumping unstructured data that I'm just not seeing. It certainly would be very unconventional, but I'm 100% open to the fact that I may be wrong. Perhaps if you shared the context which disproves my suggestion, I will humbly apologize and accept that I was wrong. Otherwise, let's remain professional and refrain from the personal attacks.